7
7
runs-on : ubuntu-latest
8
8
strategy :
9
9
matrix :
10
- php : ['8.0', '8.1', '8.2', '8.3', '8.4']
10
+ php : ['8.0', '8.1', '8.3', '8.4']
11
+ include :
12
+ - php : ' 8.2'
13
+ coverage : ' true'
11
14
12
15
name : PHP ${{ matrix.php }} tests
13
16
steps :
@@ -19,31 +22,27 @@ jobs:
19
22
with :
20
23
php-version : ${{ matrix.php }}
21
24
extensions : mbstring, json
22
- coverage : xdebug
25
+ coverage : ${{ matrix.coverage && ' xdebug' || 'none' }}
23
26
24
27
- name : Install dependencies
25
- run : composer install
26
-
27
- - name : Prepare codeclimate test reporter
28
- if : ${{ matrix.php == '8.2' }}
29
- run : |
30
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
31
- chmod +x ./cc-test-reporter
32
- ./cc-test-reporter before-build
33
-
34
- - name : Execute tests
35
- run : XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox
36
-
37
- - name : Upload the reports to coveralls.io
38
- if : ${{ matrix.php == '8.2' }}
39
- run : |
40
- composer global require php-coveralls/php-coveralls
41
- php-coveralls -v
42
- env :
43
- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
+ run : composer update --no-interaction
44
29
45
30
- name : Upload the reports to codeclimate
46
- if : ${{ matrix.php == '8.2' }}
47
- run : sudo ./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID
31
+ if : ${{ matrix.coverage }}
48
32
env :
33
+ XDEBUG_MODE : coverage
49
34
CC_TEST_REPORTER_ID : 5e32818628fac9eb11d34e2b35289f88169610cc4a98c6f170c74923342284f1
35
+ uses : paambaati/codeclimate-action@v9
36
+ with :
37
+ coverageCommand : |
38
+ ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox
39
+
40
+ - name : Upload the reports to coveralls.io
41
+ if : ${{ matrix.coverage }}
42
+ env :
43
+ COVERALLS_REPO_TOKEN : ${{ github.token }}
44
+ uses : coverallsapp/github-action@v2
45
+ with :
46
+ github-token : ${{ env.COVERALLS_REPO_TOKEN }}
47
+ flag-name : Unit
48
+ allow-empty : false
0 commit comments