From ebd8bab26ee8c053178a33a43fb6106f798dd56f Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Fri, 13 Oct 2023 22:02:27 +0200 Subject: [PATCH] Use env vars for PHP versions --- .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 80946cd..70c3285 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.2" + php-version: ${{ env.PSALM_PHP_VERSION }} - name: Install composer dependencies uses: "ramsey/composer-install@v1" @@ -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 }}