From bf9bc1ec42f85586e106d02c50af7153822306e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Sun, 27 Nov 2022 17:40:42 +0100 Subject: [PATCH] Use shivammathur/setup-php for GitHub Actions tests to allow more PHP versions than what's installed on ubuntu-latest which is just 8.1 at the moment - https://github.com/actions/runner-images/issues/6399 - https://github.com/actions/runner-images/issues/6331 --- .github/workflows/tests.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ccaf34..45beb4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,10 @@ jobs: steps: - name: OS info run: cat /etc/os-release - - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-version }} + - uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.php-version }} - name: PHP info run: | php -v @@ -26,7 +29,10 @@ jobs: - "8.1" steps: - uses: actions/checkout@v2 - - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-version }} + - uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.php-version }} - run: find -name *.php -exec php -l {} \; 2>&1 1>/dev/null | if grep "^.*error:"; then exit 1; else exit 0; fi test: @@ -37,5 +43,8 @@ jobs: - "8.1" steps: - uses: actions/checkout@v2 - - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-version }} + - uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.php-version }} - run: php site/tests/test.php