Skip to content

Update PHP workflow to use matrix strategy #25

Update PHP workflow to use matrix strategy

Update PHP workflow to use matrix strategy #25

Workflow file for this run

name: PHPstan checks
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
standards:
runs-on: ubuntu-latest
name: Check standards
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Cache hash
id: get-cache-hash
run: |
COMPOSER_HASH=`cat composer.json | sha256sum | head -c 40`
DATE=`date -u "+%Y%m%d"`
echo "hash=$COMPOSER_HASH$DATE" >> "$GITHUB_OUTPUT"
shell: bash
- name: Cache Composer dependencies
uses: actions/cache@v3
id: cache
with:
path: vendor
key: ${{ runner.os }}-${{steps.get-cache-hash.outputs.hash}}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Run phpstan tests
run: composer ci-phpstan
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{steps.get-cache-hash.outputs.hash}}