Skip to content

Update PHP workflow to use matrix strategy #24

Update PHP workflow to use matrix strategy

Update PHP workflow to use matrix strategy #24

Workflow file for this run

name: PHP Style checks
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
style:
runs-on: ubuntu-latest
name: Check coding style
permissions:
checks: write
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
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 php-cs-fixer checks
run: |
composer ci-php-cs-fixer 1> php-cs-fixer.xml
shell: bash
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: php-cs-fixer report
path: ./php-cs-fixer.xml
reporter: java-junit
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-${{steps.get-cache-hash.outputs.hash}}