Skip to content

Commit 61f2240

Browse files
authored
Merge pull request #90 from szepeviktor/patch-1
Make use of GHA features
2 parents 6483852 + 7afc0d3 commit 61f2240

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
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'
1114

1215
name: PHP ${{ matrix.php }} tests
1316
steps:
@@ -19,31 +22,27 @@ jobs:
1922
with:
2023
php-version: ${{ matrix.php }}
2124
extensions: mbstring, json
22-
coverage: xdebug
25+
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
2326

2427
- 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
4429

4530
- 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 }}
4832
env:
33+
XDEBUG_MODE: coverage
4934
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

Comments
 (0)