Support Symfony 7 (#1284) #116
Workflow file for this run
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: 'Continuous integration' | |
on: ['push', 'pull_request'] | |
jobs: | |
cs: | |
runs-on: 'ubuntu-20.04' | |
name: 'Coding style' | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v2' | |
- name: 'Setup PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '8.1' | |
coverage: 'none' | |
extensions: 'json, mbstring, tokenizer' | |
tools: 'composer-normalize, php-cs-fixer:3.11.0' | |
- name: 'Display tools versions' | |
run: | | |
composer-normalize --version | |
php-cs-fixer --version | |
- name: 'Check PHP code' | |
run: 'php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no' | |
- name: 'Check composer.json' | |
run: 'composer-normalize --diff --dry-run --no-update-lock' | |
if: 'always()' | |
phpunit: | |
runs-on: 'ubuntu-20.04' | |
name: 'PHPUnit (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})' | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
php: ['8.1', '8.0'] | |
symfony: ['6.*', '5.*', '4.*'] | |
include: | |
- php: '7.2' | |
symfony: '5.*' | |
twig: '2.*' | |
- php: '7.2' | |
symfony: '4.*' | |
twig: '2.*' | |
fail-fast: false | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v2' | |
- name: 'Setup PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '${{ matrix.php }}' | |
coverage: 'none' | |
tools: 'pecl, composer:v2' | |
extensions: 'curl, json, mbstring, openssl' | |
- name: 'Get composer cache directory' | |
id: 'composer_cache' | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: 'Cache dependencies' | |
uses: 'actions/cache@v2' | |
with: | |
path: '${{ steps.composer_cache.outputs.dir }}' | |
key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}' | |
restore-keys: | | |
${{ runner.os }}-composer-php${{ matrix.php }}- | |
${{ runner.os }}-composer- | |
- name: 'Update dependencies' | |
env: | |
SYMFONY_REQUIRE: '${{ matrix.symfony }}' | |
run: | | |
composer require --no-progress --no-scripts --no-plugins --no-update symfony/flex | |
[[ -n "${{ matrix.twig }}" ]] && composer require --no-progress --no-scripts --no-plugins --no-update twig/twig:${{ matrix.twig }} || true | |
composer update --no-interaction --no-progress --no-scripts --ansi ${{ matrix.composer_flags }} | |
- name: 'Run unit tests' | |
run: | | |
vendor/bin/phpunit |