-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (98 loc) · 2.39 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
'on':
- pull_request
- push
env:
LANG: C
jobs:
phpSyntaxCheck:
name: 'PHP Syntax Check (PHP ${{ matrix.php.version }})'
strategy:
matrix:
php:
-
version: '8.1'
experimental: false
-
version: '8.2'
experimental: false
-
version: '8.3'
experimental: false
-
version: '8.4'
experimental: true
runs-on: ubuntu-24.04
steps:
-
uses: actions/checkout@v4
-
name: 'Set up PHP ${{ matrix.php.version }}'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php.version }}'
-
name: 'Syntax check'
continue-on-error: '${{ matrix.php.experimental }}'
run: |
find . \( -type d \( -name '.git' -or -name 'vendor' \) -prune \) -or \( -type f -name '*.php' -print \) \
| sort \
| xargs ${{ matrix.php.version >= 8.3 && ' ' || '-n 1'}} php -l
phpStyleCheck:
name: 'PHP Coding Style'
runs-on: ubuntu-24.04
steps:
-
uses: actions/checkout@v4
-
name: 'Set up PHP 8.1'
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
-
name: 'Install PHP dependencies'
run: 'composer install --prefer-dist'
-
name: 'Run PHPCS'
run: |
vendor/bin/phpcs
-
name: 'Run PHPStan'
continue-on-error: true
run: |
vendor/bin/phpstan analyze --memory-limit=1G
phpTest:
name: 'PHP test (${{ matrix.php.version }})'
strategy:
matrix:
php:
-
version: '8.1'
experimental: false
-
version: '8.2'
experimental: false
-
version: '8.3'
experimental: false
-
version: '8.4'
experimental: true
runs-on: ubuntu-24.04
continue-on-error: '${{ matrix.php.experimental }}'
steps:
-
uses: actions/checkout@v4
-
name: 'Set up PHP ${{ matrix.php.version }}'
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php.version }}'
-
name: 'Install packages'
run: |
composer install --prefer-dist
-
name: 'Run test'
run: |
vendor/bin/phpunit