From 76008158a81c4f6796c16e039bd0a77e7f3fe1d7 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Mon, 9 Jan 2023 18:53:01 +0100 Subject: [PATCH] Use env vars for CI PHP version config --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 837a688..4a7fa39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: push: pull_request: +env: + PSALM_PHP_VERSION: "8.2" + COVERAGE_PHP_VERSION: "8.2" + jobs: psalm: name: Psalm @@ -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" @@ -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 }}