From e79e546d49cac980787650f88a8345d8411f334a Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Thu, 25 Apr 2024 14:29:53 +0200 Subject: [PATCH] Env vars for Psalm & coverage PHP versions, use actions/checkout@v4 --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5979f50..52e81e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: push: pull_request: +env: + PSALM_PHP_VERSION: "8.3" + COVERAGE_PHP_VERSION: "8.3" + jobs: psalm: name: Psalm @@ -11,12 +15,12 @@ jobs: 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" @@ -44,7 +48,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -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 }}