[ci] Use docker image to run PHP at version #132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Tests | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
env: | ||
PHP_VERSION: 'v8.3.2' | ||
jobs: | ||
composer_install: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/medleybox/php-cli:${{ env.PHP_VERSION }} | ||
Check failure on line 15 in .github/workflows/php.yml GitHub Actions / PHP TestsInvalid workflow file
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress | ||
test: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/medleybox/php-cli:${{ env.PHP_VERSION }} | ||
needs: [composer_install] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Run bin/run-tests | ||
run: bin/run-tests |