Add support for Symfony 7 #25
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: PHP Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
- '[0-9]+.x' | |
- '[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.x' | |
jobs: | |
test: | |
name: '${{ matrix.php-version }} ${{ matrix.dependencies }}, Storage ${{ matrix.storage }}, Coverage ${{ matrix.coverage }}' | |
runs-on: ubuntu-20.04 | |
env: | |
COVERAGE: ${{ matrix.coverage }} | |
STORAGE: ${{ matrix.storage }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- php-version: '8.0' | |
coverage: '--coverage-clover=coverage.clover' | |
storage: doctrine | |
phpunit-config: 'phpunit-9.xml.dist' | |
- php-version: '8.0' | |
storage: array | |
phpunit-config: 'phpunit-9.xml.dist' | |
- php-version: '8.1' | |
storage: doctrine | |
phpunit-config: 'phpunit-9.xml.dist' | |
- php-version: '8.1' | |
storage: array | |
phpunit-config: 'phpunit-9.xml.dist' | |
- php-version: '8.2' | |
storage: doctrine | |
- php-version: '8.2' | |
storage: array | |
- php-version: '8.3' | |
storage: doctrine | |
- php-version: '8.3' | |
storage: array | |
- php-version: '8.4' | |
storage: doctrine | |
composer-flags: --ignore-platform-reqs | |
- php-version: '8.4' | |
storage: array | |
composer-flags: --ignore-platform-reqs | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v2 | |
with: | |
# Fetch 10 commits or Scrutinizer will throw ("Failed to retrieve commit parents. If you use a shallow git checkout, please checkout at least a depth of one."), see: RepositoryIntrospector at scrutinizer-ci/ocular GitHub repository | |
# 10 commits is an arbitrary value that is more than 1 commit | |
fetch-depth: 10 | |
- name: Install and configure PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: "pdo, pdo_sqlite" | |
coverage: "pcov" | |
tools: 'composer:v2' | |
- name: Install dependencies with Composer | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: ${{ matrix.dependencies }} | |
composer-options: --prefer-dist --no-suggest ${{ matrix.composer-flags }} | |
- name: Doctrine | |
if: matrix.storage == 'doctrine' | |
run: | | |
tests/app/console doctrine:database:create | |
tests/app/console doctrine:schema:create | |
- name: Execute test | |
run: vendor/bin/phpunit -c ${{ matrix.phpunit-config || 'phpunit.xml.dist' }} ${{ matrix.coverage }} | |
- name: Coverage | |
if: matrix.coverage | |
run: | | |
composer global require scrutinizer/ocular | |
~/.composer/vendor/bin/ocular code-coverage:upload --access-token="230ec5e01daf5bb3e46ea304fb20348b52d80de73463ec08ee9c96fcd1349e35" --format=php-clover coverage.clover |