Skip to content

Commit

Permalink
Use env vars for PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Oct 13, 2023
1 parent cbd585a commit ebd8bab
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.2"
php-version: ${{ env.PSALM_PHP_VERSION }}

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

- name: Run PHPUnit
run: vendor/bin/phpunit
if: ${{ matrix.php-version != '8.2' }}
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.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 ebd8bab

Please sign in to comment.