Skip to content

Merge PR #17 from @zonky2 #76

Merge PR #17 from @zonky2

Merge PR #17 from @zonky2 #76

Workflow file for this run

name: Code Quality Diagnostics
on:
pull_request:
push:
branches:
- master
- 'release/*'
- 'hotfix/*'
jobs:
build:
runs-on: ubuntu-latest
name: 'PHP: ${{ matrix.php }} Contao: ${{ matrix.contao }}'
strategy:
fail-fast: false
matrix:
include:
- php: '7.4'
output: '-o github-action -o default'
phpcq_install: 'update'
contao: '~4.13.0'
- php: '8.0'
output: '-o default'
phpcq_install: 'update'
contao: '~4.13.0'
- php: '8.1'
output: '-o default'
phpcq_install: 'install'
contao: '~4.13.0'
- php: '8.2'
output: '-o default'
phpcq_install: 'update'
contao: '~4.13.0'
- php: '8.3'
output: '-o default'
phpcq_install: 'update'
contao: '~4.13.0'
steps:
- name: Pull source
uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# setup caches
- name: Cache composer cache directory
uses: actions/cache@v4
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}
- name: Cache vendor directory
uses: actions/cache@v4
env:
cache-name: vendor
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-
- name: Cache phpcq directory
uses: actions/cache@v4
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
# install dependencies and tools
- name: Install composer dependencies
run: |
composer require contao/core-bundle ${{ matrix.contao }} --no-update
composer install
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
# run tests
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
- name: Upload build directory to artifact
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }}
path: .phpcq/build/