Skip to content

Commit

Permalink
add coverage collect and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Feb 13, 2024
1 parent 0d11ced commit 89d139e
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,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 @@ -59,17 +59,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
- name: Run code coverage
run: vendor/bin/simple-phpunit --colors=always --coverage-clover coverage.xml
if: ${{ matrix.php-version == '8.3' && startsWith(matrix.sf-version, '7.0') }}
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 @@ -109,3 +111,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@v3
with:
path: reports

- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
directory: reports

0 comments on commit 89d139e

Please sign in to comment.