Skip to content

Commit

Permalink
Use shivammathur/setup-php for GitHub Actions tests to allow more PHP…
Browse files Browse the repository at this point in the history
… versions than what's installed on ubuntu-latest which is just 8.1 at the moment

- actions/runner-images#6399
- actions/runner-images#6331
  • Loading branch information
spaze committed Nov 27, 2022
1 parent b828243 commit bf9bc1e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

0 comments on commit bf9bc1e

Please sign in to comment.