Skip to content

Commit

Permalink
Use env vars for CI PHP version config
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Jan 9, 2023
1 parent c8066e6 commit 7600815
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
pull_request:

env:
PSALM_PHP_VERSION: "8.2"
COVERAGE_PHP_VERSION: "8.2"

jobs:
psalm:
name: Psalm
Expand All @@ -16,7 +20,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
php-version: ${{ env.PSALM_PHP_VERSION }}

- name: Install composer dependencies
uses: "ramsey/composer-install@v1"
Expand Down Expand Up @@ -58,16 +62,16 @@ jobs:

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

- name: Run PHPUnit with coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --fail-on-skipped --coverage-clover build/logs/clover.xml
if: ${{ matrix.php-version == '8.2' }}
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.2' }}
if: ${{ matrix.php-version == env.COVERAGE_PHP_VERSION }}

0 comments on commit 7600815

Please sign in to comment.