Skip to content

Merge pull request #21 from stefanheimes/patch-1 #11

Merge pull request #21 from stefanheimes/patch-1

Merge pull request #21 from stefanheimes/patch-1 #11

Workflow file for this run

name: Code Quality Diagnostics
on:
pull_request:
push:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
name: PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
include:
- php: '7.4'
phpcq_install: 'install'
phpcq_flags: ''
- php: '8.0'
phpcq_install: 'update'
phpcq_flags: ''
- php: '8.1'
phpcq_install: 'update'
phpcq_flags: ''
steps:
- name: Pull source
uses: actions/checkout@v3
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug2
- name: Cache composer cache directory
uses: actions/cache@v3
env:
cache-name: composer-cache-dir-${{ matrix.php }}
with:
path: ~/.cache/composer
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install composer dependencies
run: composer install
- name: Cache vendor directory of phpcq tool runner
uses: actions/cache@v3
env:
cache-name: vendor-${{ matrix.php }}
with:
path: $GITHUB_WORKSPACE/vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Update phpcq
run: $GITHUB_WORKSPACE/vendor/bin/phpcq self-update --unsigned
- name: Install phpcq toolchain
run: $GITHUB_WORKSPACE/vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
- name: Run tests
run: $GITHUB_WORKSPACE/vendor/bin/phpcq run -o github-action -o default ${{ matrix.phpcq_flags }} -v
- name: Upload build directory to artifact
uses: actions/upload-artifact@v3
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}
path: .phpcq/build/