[Turbo] Fix Turbo CI (PHPStan & Functional tests) #14
This file contains hidden or 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: Functional Tests | |
on: | |
push: | |
paths: | |
- '.github/workflows/functional-tests.yml' | |
- 'src/Turbo/**' | |
pull_request: | |
paths: | |
- '.github/workflows/functional-tests.yml' | |
- 'src/Turbo/**' | |
jobs: | |
turbo-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.1', '8.2', '8.3', '8.4'] | |
dependency-version: [''] | |
symfony-version: [''] | |
minimum-stability: ['stable'] | |
include: | |
# dev packages (probably not needed to have multiple such jobs) | |
- minimum-stability: 'dev' | |
php-version: '8.4' | |
# lowest deps | |
- php-version: '8.1' | |
dependency-version: 'lowest' | |
# LTS version of Symfony | |
- php-version: '8.1' | |
symfony-version: '6.4.*' | |
env: | |
SYMFONY_REQUIRE: ${{ matrix.symfony-version }} | |
services: | |
mercure: | |
image: dunglas/mercure | |
env: | |
SERVER_NAME: :3000 | |
MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!' | |
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!' | |
MERCURE_EXTRA_DIRECTIVES: | | |
anonymous | |
cors_origins * | |
ports: | |
- 3000:3000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: flex | |
- name: Install dependencies with composer | |
working-directory: src/Turbo | |
run: | | |
composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} | |
composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction | |
- name: Install JavaScript dependencies | |
working-directory: src/Turbo/tests/app | |
run: | | |
php public/index.php importmap:install | |
php public/index.php asset-map:compile | |
- name: Create DB | |
working-directory: src/Turbo/tests/app | |
run: php public/index.php doctrine:schema:create | |
- name: Run tests | |
working-directory: src/Turbo | |
run: | | |
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak | |
vendor/bin/simple-phpunit | |
env: | |
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1' |