@@ -2,9 +2,9 @@ name: Run tests with coverage
22
33on :
44 push :
5- branches : ["master"]
5+ branches : [ "master" ]
66 pull_request :
7- branches : ["master"]
7+ branches : [ "master" ]
88
99jobs :
1010 tests-with-coverage :
@@ -13,17 +13,41 @@ jobs:
1313 matrix :
1414 php-version : [ "8.3", "8.4" ]
1515 steps :
16- - uses : shivammathur/setup-php@v2
16+ - name : Set up PHP
17+ uses : shivammathur/setup-php@v2
1718 with :
1819 php-version : ${{ matrix.php-version }}
19- - uses : actions/checkout@v3
20+ coverage : xdebug
21+ tools : composer
22+ - name : Checkout
23+ uses : actions/checkout@v4
2024 - name : Install Dependencies
2125 run : composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
2226 - name : Execute unit tests via PHPUnit with coverage
2327 run : vendor/bin/phpunit --coverage-clover build/logs/clover.xml
28+ - name : Export coverage report
29+ if : ${{ matrix.php-version == '8.4' }}
30+ uses : actions/upload-artifact@v4
31+ with :
32+ name : clover.xml
33+ path : build/logs
34+
35+ upload-to-coveralls :
36+ needs : tests-with-coverage
37+ runs-on : ubuntu-latest
38+ steps :
39+ - name : Set up PHP
40+ uses : shivammathur/setup-php@v2
41+ - name : Checkout
42+ uses : actions/checkout@v4
43+ - name : Import coverage report
44+ uses : actions/download-artifact@v4
45+ with :
46+ name : clover.xml
47+ path : build/logs
2448 - name : Upload coverage results to Coveralls
2549 env :
2650 COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2751 run : |
2852 composer global require php-coveralls/php-coveralls
29- php-coveralls --coverage_clover=build/logs/clover.xml -v
53+ php-coveralls --coverage_clover=build/logs/clover.xml -v --json_path=coveralls-upload.json
0 commit comments