Skip to content

Commit 4664183

Browse files
authored
Update PHPUnit workflow for PHP version and coverage
1 parent 3196f3c commit 4664183

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/phpunit.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: PHPUnit Tests
22

33
on: [push, pull_request]
44

5-
env:
6-
CC_TEST_REPORTER_ID: 1d1f74ba47a7d5ca9fd110c771ddac54d67608513924b89df2b7ed8761541244
7-
85
jobs:
96
test:
107
runs-on: ubuntu-latest
@@ -14,14 +11,15 @@ jobs:
1411

1512
steps:
1613
- name: Checkout code
17-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1815

1916
- name: Setup PHP
2017
uses: shivammathur/setup-php@v2
2118
with:
2219
php-version: ${{ matrix.php }}
2320
extensions: mbstring
2421
tools: composer
22+
coverage: xdebug
2523
env:
2624
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2725

@@ -31,9 +29,12 @@ jobs:
3129
- name: Run tests
3230
run: ./vendor/bin/phpunit --coverage-clover=clover.xml --configuration actions.phpunit.xml
3331

34-
- name: Code coverage
35-
run: |
36-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
37-
chmod +x ./cc-test-reporter
38-
./cc-test-reporter after-build -t clover
39-
if: matrix.php == '8.1'
32+
- name: Upload coverage reports to Codecov
33+
uses: codecov/codecov-action@v5
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
files: ./clover.xml
37+
flags: php-${{ matrix.php }}
38+
fail_ci_if_error: false
39+
verbose: true
40+
if: matrix.php == '8.1'

0 commit comments

Comments
 (0)