@@ -8,9 +8,6 @@ concurrency:
8
8
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9
9
cancel-in-progress : true
10
10
11
- env :
12
- COVERAGE : ' 0'
13
-
14
11
jobs :
15
12
build :
16
13
name : Build and Test
@@ -21,13 +18,21 @@ jobs:
21
18
- ' 7.4'
22
19
- ' 8.0'
23
20
- ' 8.1'
21
+ - ' 8.2'
24
22
include :
25
- - php : ' 8.1'
26
- coverage : true
27
- phpstan : true
23
+ - php : ' 8.2'
24
+ latest : true
28
25
steps :
29
26
- uses : actions/checkout@v3
30
27
28
+ - name : Setup PHP
29
+ uses : shivammathur/setup-php@v2
30
+ with :
31
+ php-version : ${{ matrix.php }}
32
+ ini-values : memory_limit=-1
33
+ coverage : pcov
34
+ tools : composer, cs2pr, php-cs-fixer
35
+
31
36
- name : Get Composer Cache Directory
32
37
id : composer-cache
33
38
run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
@@ -38,55 +43,41 @@ jobs:
38
43
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
39
44
restore-keys : ${{ runner.os }}-composer-
40
45
41
- - name : Setup PHP with extensions
42
- uses : shivammathur/setup-php@v2
43
- with :
44
- php-version : ${{ matrix.php }}
45
- extensions : json
46
- ini-values : memory_limit=-1
47
- coverage : pcov
48
- tools : composer, cs2pr, php-cs-fixer
49
-
50
46
- name : Install prerequisites
51
47
run : |
52
48
wget -O box.phar https://github.com/humbug/box/releases/download/4.3.8/box.phar
53
49
echo "BOX_BIN=$(pwd)/box.phar" >> $GITHUB_ENV
54
50
sudo chown -R $(whoami):$(whoami) .
55
51
56
52
- name : Install dependencies
57
- if : startsWith( matrix.php, '8.1')
53
+ if : matrix.latest
58
54
run : composer install --prefer-dist --no-interaction --no-progress --ansi
59
55
60
56
- name : Update dependencies
61
- if : " !startsWith( matrix.php, '8.1') "
57
+ if : " !matrix.latest "
62
58
run : composer update --no-interaction --no-progress --ansi
63
59
64
60
- name : Enable code coverage
65
- if : matrix.coverage
61
+ if : matrix.latest
66
62
run : echo "COVERAGE=1" >> $GITHUB_ENV
67
63
68
- - name : Run phpunit
69
- run : |
70
- mkdir -p build/logs/phpunit
71
- if [ "$COVERAGE" = '1' ]; then
72
- vendor/bin/simple-phpunit --coverage-clover build/logs/phpunit/clover.xml
73
- else
74
- vendor/bin/simple-phpunit
75
- fi
64
+ - name : Run PHPUnit
65
+ run : vendor/bin/simple-phpunit ${{ matrix.latest && '--coverage-clover build/logs/phpunit/clover.xml' || '' }}
76
66
77
- - name : Run php-cs-fixer
67
+ - name : Run PHP CS Fixer
68
+ if : matrix.latest
78
69
run : php-cs-fixer fix --dry-run --format=checkstyle --ansi | cs2pr
79
70
80
- - name : Run phpstan
81
- if : matrix.phpstan
71
+ - name : Run PHPStan
72
+ if : matrix.latest
82
73
run : vendor/bin/phpstan analyse --ansi
83
74
84
75
- name : Run e2e tests
85
- if : startsWith( matrix.php, '8.1')
76
+ if : matrix.latest
86
77
run : bin/compile
87
78
88
79
- name : Upload coverage results to Coveralls
89
- if : matrix.coverage
80
+ if : matrix.latest
90
81
env :
91
82
COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
83
run : |
0 commit comments