Skip to content

Commit

Permalink
Env var for coverage PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Apr 25, 2024
1 parent 57d551e commit 14395b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
pull_request:

env:
COVERAGE_PHP_VERSION: "8.3"

jobs:
phpunit:
name: PHPUnit
Expand Down Expand Up @@ -42,16 +45,16 @@ jobs:

- name: Run PHPUnit
run: vendor/bin/phpunit
if: ${{ matrix.php-version != '8.3' }}
if: ${{ matrix.php-version != env.COVERAGE_PHP_VERSION }}

- name: Run PHPUnit with coverage
run: |
mkdir -p mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
if: ${{ matrix.php-version == '8.3' }}
if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

- name: Upload coverage report to Coveralls
run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.php-version == '8.3' }}
if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

0 comments on commit 14395b6

Please sign in to comment.