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 28, 2022
1 parent a92292d commit a76c7b3
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
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 @@ -37,7 +40,10 @@ jobs:
- "8.1"
steps:
- uses: actions/checkout@v3
- 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: composer --working-dir=site check-file-patterns


Expand All @@ -49,7 +55,10 @@ jobs:
- "8.1"
steps:
- uses: actions/checkout@v3
- 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: composer --working-dir=site lint

lint-latte:
Expand All @@ -60,7 +69,10 @@ jobs:
- "8.1"
steps:
- uses: actions/checkout@v3
- 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: composer --working-dir=site lint-latte

lint-neon:
Expand All @@ -71,7 +83,10 @@ jobs:
- "8.1"
steps:
- uses: actions/checkout@v3
- 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: composer --working-dir=site lint-neon

phpcs:
Expand All @@ -89,7 +104,10 @@ jobs:
with:
path: ${{ steps.phpcs-cache.outputs.file }}
key: phpcs-cache-php${{ matrix.php-version }}
- 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: composer --working-dir=site phpcs

phpstan:
Expand All @@ -107,7 +125,10 @@ jobs:
with:
path: ${{ steps.phpstan-cache.outputs.dir }}
key: phpstan-cache-php${{ matrix.php-version }}
- 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: composer --working-dir=site phpstan

phpstan-vendor:
Expand All @@ -125,7 +146,10 @@ jobs:
with:
path: ${{ steps.phpstan-cache.outputs.dir }}
key: phpstan-vendor-cache-php${{ matrix.php-version }}
- 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: composer --working-dir=site run-script --timeout=600 phpstan-vendor

tester:
Expand All @@ -136,7 +160,10 @@ jobs:
- "8.1"
steps:
- uses: actions/checkout@v3
- 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: composer --working-dir=site tester
- name: Failed test output, if any
if: failure()
Expand Down

0 comments on commit a76c7b3

Please sign in to comment.