Allow Symfony 7 #11
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: "build" | |
on: | |
push: | |
branches: | |
- "*.x" | |
pull_request: ~ | |
workflow_dispatch: ~ | |
jobs: | |
coding-standards: | |
name: "Coding Standards" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
dependencies: | |
- "highest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP, with composer and extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
coverage: "none" | |
- name: "Install composer dependencies" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Validate composer" | |
run: "composer validate --strict" | |
- name: "Check composer normalized" | |
run: "composer normalize --dry-run" | |
- name: "Check style" | |
run: "composer check-style" | |
dependency-analysis: | |
name: "Dependency Analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
dependencies: | |
- "lowest" | |
- "highest" | |
symfony: | |
- "~6.0.0" | |
- "~6.1.0" | |
- "~6.2.0" | |
- "~6.3.0" | |
- "~6.4.0" | |
- "~7.0.0" | |
exclude: | |
- php-version: "8.1" | |
symfony: "~7.0.0" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP, with composer and extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
php-version: "${{ matrix.php-version }}" | |
tools: "composer-require-checker, composer-unused, flex" | |
- name: "Install composer dependencies" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
env: | |
SYMFONY_REQUIRE: "${{ matrix.symfony }}" | |
- name: "Run maglnet/composer-require-checker" | |
run: "composer-require-checker check" | |
- name: "Run composer-unused/composer-unused" | |
run: "composer-unused" | |
static-code-analysis: | |
name: "Static Code Analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
dependencies: | |
- "lowest" | |
- "highest" | |
symfony: | |
- "~6.0.0" | |
- "~6.1.0" | |
- "~6.2.0" | |
- "~6.3.0" | |
- "~6.4.0" | |
- "~7.0.0" | |
exclude: | |
- php-version: "8.1" | |
symfony: "~7.0.0" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP, with composer and extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
coverage: "none" | |
tools: "flex" | |
- name: "Install composer dependencies" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
env: | |
SYMFONY_REQUIRE: "${{ matrix.symfony }}" | |
- name: "Static analysis" | |
run: "vendor/bin/psalm --php-version=${{ matrix.php-version }}" | |
unit-tests: | |
name: "Unit tests" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
dependencies: | |
- "lowest" | |
- "highest" | |
symfony: | |
- "~6.0.0" | |
- "~6.1.0" | |
- "~6.2.0" | |
- "~6.3.0" | |
- "~6.4.0" | |
- "~7.0.0" | |
exclude: | |
- php-version: "8.1" | |
symfony: "~7.0.0" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP, with composer and extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
coverage: "none" | |
tools: "flex" | |
- name: "Install composer dependencies" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
env: | |
SYMFONY_REQUIRE: "${{ matrix.symfony }}" | |
- name: "Run phpunit" | |
run: "composer phpunit" | |
code-coverage: | |
name: "Code Coverage" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.2" | |
dependencies: | |
- "highest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Setup PHP, with composer and extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "pcov" | |
extensions: "${{ env.PHP_EXTENSIONS }}" | |
php-version: "${{ matrix.php-version }}" | |
- name: "Set up problem matchers for phpunit/phpunit" | |
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" | |
- name: "Install composer dependencies" | |
uses: "ramsey/composer-install@v2" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Collect code coverage with pcov and phpunit/phpunit" | |
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml" | |
- name: "Send code coverage report to Codecov.io" | |
env: | |
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | |
run: "bash <(curl -s https://codecov.io/bash)" |