Skip to content

Commit e8baa67

Browse files
committed
Added CodeCov coverage report support
1 parent 9213c77 commit e8baa67

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed

.github/workflows/tests.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ jobs:
3030
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
3131
include:
3232
- php-version: '7.4'
33-
sf-version: '5.4.*'
33+
sf-version: '5.4'
3434
- php-version: '8.0'
35-
sf-version: '6.0.*'
35+
sf-version: '6.0'
3636
- php-version: '8.1'
37-
sf-version: '6.0.*'
37+
sf-version: '6.0'
3838
- php-version: '8.1'
39-
sf-version: '6.1.*'
39+
sf-version: '6.1'
4040
- php-version: '8.2'
41-
sf-version: '6.2.*'
41+
sf-version: '6.2'
4242
- php-version: '8.3'
43-
sf-version: '6.3.*'
43+
sf-version: '6.3'
4444
- php-version: '8.3'
45-
sf-version: '6.4.*'
45+
sf-version: '6.4'
4646
- php-version: '8.3'
47-
sf-version: '7.0.*'
47+
sf-version: '7.0'
4848

4949
name: integration-tests (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }})
5050
steps:
@@ -58,14 +58,19 @@ jobs:
5858
run: composer validate
5959
- name: Install dependencies
6060
env:
61-
SYMFONY_REQUIRE: ${{ matrix.sf-version }}
61+
SYMFONY_REQUIRE: '${{ matrix.sf-version }}.*'
6262
run: composer install --prefer-dist --no-progress
63-
- name: "Remove doctrine/annotations"
63+
- name: Remove doctrine/annotations
6464
if: matrix.php-version != '7.4'
6565
run: |
6666
composer remove --dev doctrine/annotations
6767
- name: Run test suite
68-
run: composer test:unit
68+
run: composer test:unit -- --coverage-clover coverage.xml
69+
- name: Upload coverage file
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: 'phpunit-${{ matrix.php-version }}-${{ matrix.sf-version }}-coverage'
73+
path: 'coverage.xml'
6974

7075
code-style:
7176
runs-on: ubuntu-latest
@@ -105,3 +110,25 @@ jobs:
105110
uses: ibiqlik/action-yamllint@v3
106111
with:
107112
config_file: .yamllint.yml
113+
114+
upload-coverage:
115+
name: Upload coverage to Codecov
116+
runs-on: ubuntu-latest
117+
needs:
118+
- integration-tests
119+
120+
steps:
121+
- name: Checkout
122+
uses: actions/checkout@v4
123+
with:
124+
fetch-depth: 2
125+
126+
- name: Download coverage files
127+
uses: actions/download-artifact@v3
128+
with:
129+
path: reports
130+
131+
- name: Upload to Codecov
132+
uses: codecov/codecov-action@v3
133+
with:
134+
directory: reports

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<env name="MEILISEARCH_PREFIX" value="sf_phpunit_"/>
1515
<env name="MEILISEARCH_URL" value="http://127.0.0.1:7700"/>
1616
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
17+
<env name="SYMFONY_PHPUNIT_VERSION" value="9.6"/>
1718
</php>
1819
<testsuites>
1920
<testsuite name="Integration">

0 commit comments

Comments
 (0)