Support symfony 7 #350
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: 'CI' | |
on: | |
workflow_dispatch: ~ | |
push: | |
branches: | |
- master | |
pull_request: ~ | |
jobs: | |
lint: | |
name: 'Lint' | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v2 | |
- name: 'Setup PHP' | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: "none" | |
extensions: "json" | |
ini-values: "memory_limit=-1" | |
php-version: "8.3" | |
- name: 'Determine composer cache directory' | |
id: composer-cache | |
run: echo "::set-output name=directory::$(composer config cache-dir)" | |
- name: 'Cache composer dependencies' | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.directory }} | |
key: lint-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: lint-composer- | |
- name: 'Install dependencies' | |
id: deps | |
run: | | |
echo "::group::composer update" | |
composer update --no-progress --ansi | |
echo "::endgroup::" | |
echo "::group::install phpunit" | |
# Required for PhpStan | |
vendor/bin/simple-phpunit install | |
echo "::endgroup::" | |
- name: 'Composer validate' | |
if: always() && steps.deps.outcome == 'success' | |
run: composer validate --strict | |
- name: 'PHP CS Fixer' | |
if: always() && steps.deps.outcome == 'success' | |
run: | | |
make php-cs-fixer.phar | |
./php-cs-fixer.phar fix --dry-run --diff | |
- name: 'PhpStan' | |
if: always() && steps.deps.outcome == 'success' | |
run: vendor/bin/phpstan analyse | |
- name: 'Lint YAML' | |
if: always() && steps.deps.outcome == 'success' | |
run: vendor/bin/yaml-lint --parse-tags config tests/fixtures/app/config | |
- name: 'Lint Twig' | |
if: always() && steps.deps.outcome == 'success' | |
run: bin/lint.twig.php templates | |
tests: | |
name: 'Tests' | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
continue-on-error: ${{ matrix.allow-failure == 1 }} | |
strategy: | |
fail-fast: false # don't cancel other matrix jobs on failure | |
matrix: | |
include: | |
# Previous PHP versions | |
- name: 'Test Symfony 5.4 [Linux, PHP 7.4]' | |
os: 'ubuntu-latest' | |
php: '7.4' | |
symfony: '5.4.*' | |
# Most recent, non-EOL versions | |
- name: 'Test Symfony 5.4 [Linux, PHP 8.1]' | |
os: 'ubuntu-latest' | |
php: '8.1' | |
symfony: '5.4.*' | |
- name: 'Test Symfony 5.4 [Windows, PHP 8.0]' | |
os: 'windows-latest' | |
php: '8.0' | |
symfony: '5.4.*' | |
- name: 'Test Symfony 6.0 [Linux, PHP 8.1]' | |
os: 'ubuntu-latest' | |
php: '8.1' | |
symfony: '6.0.*' | |
- name: 'Test Symfony 6.1 [Linux, PHP 8.1]' | |
os: 'ubuntu-latest' | |
php: '8.1' | |
symfony: '6.1.*' | |
- name: 'Test Symfony 6.2 [Linux, PHP 8.1]' | |
os: 'ubuntu-latest' | |
php: '8.1' | |
symfony: '6.2.*' | |
- name: 'Test Symfony 6.4 [Linux, PHP 8.2]' | |
os: 'ubuntu-latest' | |
php: '8.2' | |
symfony: '6.4.*' | |
# Bleeding edges: | |
- name: 'Test Symfony 7.0 [Linux, PHP 8.3]' | |
os: 'ubuntu-latest' | |
php: '8.3' | |
symfony: '7.0.*@dev' | |
allow-unstable: true | |
allow-failure: true | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v2 | |
- name: 'Setup PHP' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: json | |
ini-values: 'memory_limit=-1' | |
tools: 'composer:v2,flex' | |
- 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 }}-symfony-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }}-flags-${{ matrix.composer-flags }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: 'Allow unstable packages' | |
run: composer config minimum-stability dev | |
if: ${{ matrix.allow-unstable }} | |
- name: 'Install dependencies' | |
run: | | |
echo "::group::composer update" | |
composer update --prefer-dist --no-progress ${{ matrix.composer-flags }} --ansi | |
echo "::endgroup::" | |
echo "::group::install phpunit" | |
vendor/bin/simple-phpunit install | |
echo "::endgroup::" | |
env: | |
SYMFONY_REQUIRE: "${{ matrix.symfony }}" | |
- name: 'Run tests' | |
run: vendor/bin/simple-phpunit --testdox | |
build-doc: | |
name: 'Check documentation build' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v2 | |
# https://github.com/actions/setup-node | |
- name: 'Setup node' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: 'Setup PHP' | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: "none" | |
extensions: "json" | |
ini-values: "memory_limit=-1" | |
php-version: "8.3" | |
- name: 'Determine composer cache directory' | |
id: composer-cache | |
working-directory: ./doc/app | |
run: echo "::set-output name=directory::$(composer config cache-dir)" | |
- name: 'Cache composer dependencies' | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.directory }} | |
key: composer-${{ hashFiles('./doc/app/**/composer.lock') }} | |
restore-keys: composer- | |
- name: 'Install dependencies' | |
working-directory: ./doc/app | |
run: | | |
echo "::group::composer install" | |
composer install --no-progress --ansi | |
echo "::endgroup::" | |
echo "::group::npm install" | |
npm install --color=always --no-progress | |
echo "::endgroup::" | |
- name: 'Warmup' | |
working-directory: ./doc/app | |
run: | | |
echo "::group::warmup production env" | |
npx encore production --color | |
bin/console cache:clear --ansi | |
bin/console cache:warmup --ansi | |
echo "::endgroup::" | |
env: | |
APP_ENV: prod | |
WEBPACK_PUBLIC_PATH: /Stenope/build | |
- name: 'Build static site' | |
working-directory: ./doc/app | |
run: bin/console stenope:build --no-interaction -vv --ansi | |
env: | |
APP_ENV: prod | |
ROUTER_DEFAULT_URI: https://stenopephp.github.io/Stenope |