Skip to content

Commit

Permalink
Added CodeCov coverage report support
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Norkūnas <norkunas.tom@gmail.com>
  • Loading branch information
connorhu and norkunas committed Feb 13, 2024
1 parent 9213c77 commit a760792
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
49 changes: 38 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ jobs:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
include:
- php-version: '7.4'
sf-version: '5.4.*'
sf-version: '5.4'
- php-version: '8.0'
sf-version: '6.0.*'
sf-version: '6.0'
- php-version: '8.1'
sf-version: '6.0.*'
sf-version: '6.0'
- php-version: '8.1'
sf-version: '6.1.*'
sf-version: '6.1'
- php-version: '8.2'
sf-version: '6.2.*'
sf-version: '6.2'
- php-version: '8.3'
sf-version: '6.3.*'
sf-version: '6.3'
- php-version: '8.3'
sf-version: '6.4.*'
sf-version: '6.4'
- php-version: '8.3'
sf-version: '7.0.*'
sf-version: '7.0'

name: integration-tests (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }})
steps:
Expand All @@ -58,14 +58,19 @@ jobs:
run: composer validate
- name: Install dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.sf-version }}
SYMFONY_REQUIRE: '${{ matrix.sf-version }}.*'
run: composer install --prefer-dist --no-progress
- name: "Remove doctrine/annotations"
- name: Remove doctrine/annotations
if: matrix.php-version != '7.4'
run: |
composer remove --dev doctrine/annotations
- name: Run test suite
run: composer test:unit
run: composer test:unit -- --coverage-clover coverage.xml
- name: Upload coverage file
uses: actions/upload-artifact@v3
with:
name: 'phpunit-${{ matrix.php-version }}-${{ matrix.sf-version }}-coverage'
path: 'coverage.xml'

code-style:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -105,3 +110,25 @@ jobs:
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

upload-coverage:
name: Upload coverage to Codecov
runs-on: ubuntu-latest
needs:
- integration-tests

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Download coverage files
uses: actions/download-artifact@v4
with:
path: reports

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
directory: reports
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<env name="MEILISEARCH_PREFIX" value="sf_phpunit_"/>
<env name="MEILISEARCH_URL" value="http://127.0.0.1:7700"/>
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="9.6"/>
</php>
<testsuites>
<testsuite name="Integration">
Expand Down

0 comments on commit a760792

Please sign in to comment.