Allow to run tests for different versions of symfony and database #245
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: "Run Tests" | |
on: | |
push: | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
- 'templates/**' | |
- 'config/**' | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
APP_ENV: test | |
jobs: | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
redis: ['6'] | |
driver: ['sqlite'] | |
include: | |
- php: '8.1' | |
# - php: '8.2' | |
# driver: 'mysql' | |
- php: '8.3' | |
redis: '7' | |
symfony: '7.0.*' | |
name: PHP ${{ matrix.php }} SYMFONY ${{ matrix.symfony }} - ${{ matrix.driver }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
extensions: "curl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, sqlite, zip, redis" | |
php-version: ${{ matrix.php }} | |
tools: composer | |
- name: "Install dependencies" | |
# temporary workaround to support Symfony 7.0 in tests. | |
run: | | |
set -x | |
if [[ ! -z "${{ matrix.symfony }}" ]]; then | |
export SYMFONY_REQUIRE="${{ matrix.symfony }}" | |
composer config --global --auth http-basic.demo.packeton.org token ${{ secrets.PACKETON_TOKEN }} | |
composer config repositories.sf7 composer https://demo.packeton.org/sf7 | |
composer update --ansi --no-interaction | |
else | |
composer install --ansi --no-interaction | |
fi | |
- name: Start Redis | |
uses: "supercharge/[email protected]" | |
with: | |
redis-version: ${{ matrix.redis }} | |
- name: "Run tests" | |
run: "composer tests" |