update the GitHub actions configuration #233
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: | |
- 'push' | |
- 'pull_request' | |
jobs: | |
cs-fixer: | |
name: 'PHP CS Fixer' | |
runs-on: 'ubuntu-latest' | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
steps: | |
- name: 'Check out' | |
uses: 'actions/checkout@v4' | |
- uses: actions/cache@v3 | |
with: | |
path: '.php-cs-fixer.cache' | |
key: '${{ runner.OS }}-${{ github.repository }}-phpcsfixer-${{ github.sha }}' | |
restore-keys: | | |
${{ runner.OS }}-${{ github.repository }}-phpcsfixer- | |
- name: 'Check the code style' | |
uses: 'docker://oskarstark/php-cs-fixer-ga' | |
with: | |
args: '--diff --dry-run' | |
phpstan: | |
name: 'PhpStan' | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Check out' | |
uses: 'actions/checkout@v4' | |
- name: 'Cache dependencies' | |
uses: 'actions/cache@v3' | |
with: | |
path: '/tmp/composer-cache' | |
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" | |
- name: 'Install dependencies' | |
uses: 'php-actions/composer@v6' | |
- name: 'Run PhpStan' | |
uses: 'php-actions/phpstan@v3' | |
with: | |
configuration: 'phpstan.neon' | |
level: 'max' | |
tests: | |
name: 'PHPUnit' | |
runs-on: 'ubuntu-latest' | |
strategy: | |
matrix: | |
include: | |
- php-version: '8.1' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.3.*' | |
- php-version: '8.1' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.4.*' | |
- php-version: '8.2' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.3.*' | |
- php-version: '8.2' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.4.*' | |
- php-version: '8.2' | |
composer-options: '--prefer-stable' | |
symfony-version: '7.0.*' | |
- php-version: '8.3' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.3.*' | |
- php-version: '8.3' | |
composer-options: '--prefer-stable' | |
symfony-version: '6.4.*' | |
- php-version: '8.3' | |
composer-options: '--prefer-stable' | |
symfony-version: '7.0.*' | |
steps: | |
- name: 'Check out' | |
uses: 'actions/checkout@v4' | |
- name: 'Set up PHP' | |
uses: 'shivammathur/setup-php@v2' | |
with: | |
php-version: '${{ matrix.php-version }}' | |
coverage: 'none' | |
- name: 'Cache dependencies' | |
uses: 'actions/cache@v3' | |
with: | |
path: '/tmp/composer-cache' | |
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" | |
- name: 'Initialize the global Composer environment' | |
uses: 'php-actions/composer@v6' | |
with: | |
command: 'global init --license MIT' | |
- run: | | |
cat $HOME/.config/composer/composer.json | |
- name: 'Allow the Symfony Flex plugin' | |
uses: 'php-actions/composer@v6' | |
with: | |
command: 'global config --no-plugins allow-plugins.symfony/flex true' | |
- run: | | |
cat $HOME/.config/composer/composer.json | |
- name: 'Install Symfony Flex' | |
uses: 'php-actions/composer@v6' | |
with: | |
command: 'global require symfony/flex' | |
- run: | | |
cat composer.json | |
- name: 'Install dependencies' | |
uses: 'php-actions/composer@v6' | |
env: | |
SYMFONY_REQUIRE: '${{ matrix.symfony-version }}' | |
with: | |
command: 'update --no-progress ${{ matrix.composer-options }}' | |
- name: 'Install PHPUnit' | |
run: 'vendor/bin/simple-phpunit install' | |
- name: 'Run tests' | |
run: | | |
vendor/bin/simple-phpunit --testsuite="unit tests" | |
vendor/bin/simple-phpunit --testsuite="integration tests" |