Save the file so we can download and verify it #10
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: Test application | |
on: [push, pull_request] | |
jobs: | |
Tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php-versions: ['8.1', '8.2'] | |
steps: | |
# https://github.com/actions/checkout (official) | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# https://github.com/shivammathur/setup-php (community) | |
- name: Setup PHP, extensions and composer with shivammathur/setup-php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: php-cs-fixer, cs2pr, phpstan, parallel-lint | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo | |
# Composer | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
# https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Lint PHP Files | |
working-directory: ./app | |
run: parallel-lint . --exclude vendor --checkstyle | cs2pr | |
- name: Install Composer dependencies | |
working-directory: ./app | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
# https://github.com/sensiolabs/security-checker | |
# - name: Security check installed dependencies | |
# working-directory: ./app | |
# uses: symfonycorp/security-checker-action@v2 | |
# https://github.com/chekalsky/phpcs-action (community) | |
- name: Check PSR12 code style (PHP_CodeSniffer) | |
working-directory: ./app | |
run: php-cs-fixer fix --dry-run --format=checkstyle src | cs2pr | |
# https://github.com/phpstan/phpstan | |
- name: Analyse PHP Code (PHPStan) | |
working-directory: ./app | |
run: phpstan analyse --level 8 src | |
# Symfony | |
- name: Check the Symfony console | |
working-directory: ./app | |
run: | | |
php bin/console -V | |
php bin/console about | |
# Tests | |
- name: Run unit and functional tests | |
working-directory: ./app | |
run: | | |
php vendor/bin/phpunit --stop-on-failure |