Skip to content

Commit 89d139e

Browse files
committed
add coverage collect and upload
1 parent 0d11ced commit 89d139e

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

.github/workflows/tests.yml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ jobs:
3131
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
3232
include:
3333
- php-version: '7.4'
34-
sf-version: '5.4.*'
34+
sf-version: '5.4'
3535
- php-version: '8.0'
36-
sf-version: '6.0.*'
36+
sf-version: '6.0'
3737
- php-version: '8.1'
38-
sf-version: '6.0.*'
38+
sf-version: '6.0'
3939
- php-version: '8.1'
40-
sf-version: '6.1.*'
40+
sf-version: '6.1'
4141
- php-version: '8.2'
42-
sf-version: '6.2.*'
42+
sf-version: '6.2'
4343
- php-version: '8.3'
44-
sf-version: '6.3.*'
44+
sf-version: '6.3'
4545
- php-version: '8.3'
46-
sf-version: '6.4.*'
46+
sf-version: '6.4'
4747
- php-version: '8.3'
48-
sf-version: '7.0.*'
48+
sf-version: '7.0'
4949

5050
name: integration-tests (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }})
5151
steps:
@@ -59,17 +59,19 @@ jobs:
5959
run: composer validate
6060
- name: Install dependencies
6161
env:
62-
SYMFONY_REQUIRE: ${{ matrix.sf-version }}
62+
SYMFONY_REQUIRE: '${{ matrix.sf-version }}.*'
6363
run: composer install --prefer-dist --no-progress
64-
- name: "Remove doctrine/annotations"
64+
- name: Remove doctrine/annotations
6565
if: matrix.php-version != '7.4'
6666
run: |
6767
composer remove --dev doctrine/annotations
6868
- name: Run test suite
69-
run: composer test:unit
70-
- name: Run code coverage
71-
run: vendor/bin/simple-phpunit --colors=always --coverage-clover coverage.xml
72-
if: ${{ matrix.php-version == '8.3' && startsWith(matrix.sf-version, '7.0') }}
69+
run: composer test:unit -- --coverage-clover coverage.xml
70+
- name: Upload coverage file
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: 'phpunit-${{ matrix.php-version }}-${{ matrix.sf-version }}-coverage'
74+
path: 'coverage.xml'
7375

7476
code-style:
7577
runs-on: ubuntu-latest
@@ -109,3 +111,25 @@ jobs:
109111
uses: ibiqlik/action-yamllint@v3
110112
with:
111113
config_file: .yamllint.yml
114+
115+
upload_coverage:
116+
name: Upload coverage to Codecov
117+
runs-on: ubuntu-latest
118+
needs:
119+
- integration-tests
120+
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 2
126+
127+
- name: Download coverage files
128+
uses: actions/download-artifact@v3
129+
with:
130+
path: reports
131+
132+
- name: Upload to Codecov
133+
uses: codecov/codecov-action@v3
134+
with:
135+
directory: reports

0 commit comments

Comments
 (0)