Skip to content

Commit

Permalink
Env vars for Psalm & coverage PHP versions, use actions/checkout@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Apr 25, 2024
1 parent 613ead1 commit e79e546
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ on:
push:
pull_request:

env:
PSALM_PHP_VERSION: "8.3"
COVERAGE_PHP_VERSION: "8.3"

jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- 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 @@ -44,7 +48,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -59,16 +63,16 @@ jobs:

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

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

0 comments on commit e79e546

Please sign in to comment.