Support Symfony 7.2 (#203) #647
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: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [8.1, 8.2, 8.3, 8.4] | |
symfony: ["5.4.*", "6.4.*", "7.2.*"] | |
exclude: | |
- php: 8.1 | |
symfony: "7.2.*" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
extensions: ctype, iconv, intl, json, mbstring, pdo, pdo_sqlite | |
coverage: none | |
- name: Set Symfony version reference | |
run: echo "SF_REF=${MATRIX_SYMFONY%.*}" >> $GITHUB_ENV | |
env: | |
MATRIX_SYMFONY: ${{ matrix.symfony }} | |
- name: Checkout Symfony ${{ env.SF_REF }} Sample | |
uses: actions/checkout@v4 | |
with: | |
repository: Codeception/symfony-module-tests | |
path: framework-tests | |
ref: ${{ env.SF_REF }} | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json', 'composer.lock') }} | |
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer- | |
- name: Install PHPUnit 10 | |
run: composer require --dev --no-update "phpunit/phpunit=^10.0" | |
- name: Install dependencies | |
run: | | |
composer require symfony/finder=${{ matrix.symfony }} --no-update | |
composer require symfony/yaml=${{ matrix.symfony }} --no-update | |
composer require symfony/console=${{ matrix.symfony }} --no-update | |
composer require symfony/event-dispatcher=${{ matrix.symfony }} --no-update | |
composer require symfony/css-selector=${{ matrix.symfony }} --no-update | |
composer require symfony/dom-crawler=${{ matrix.symfony }} --no-update | |
composer require symfony/browser-kit=${{ matrix.symfony }} --no-update | |
composer require vlucas/phpdotenv --no-update | |
composer require codeception/module-asserts="3.*" --no-update | |
composer require codeception/module-doctrine="3.*" --no-update | |
composer update --prefer-dist --no-progress --no-dev | |
- name: Validate Composer files | |
run: composer validate --strict | |
working-directory: framework-tests | |
- name: Install PHPUnit in framework-tests | |
run: composer require --dev --no-update "phpunit/phpunit=^10.0" | |
working-directory: framework-tests | |
- name: Prepare Symfony sample | |
run: | | |
composer remove codeception/codeception codeception/module-asserts codeception/module-doctrine codeception/lib-innerbrowser codeception/module-symfony --dev --no-update | |
composer update --no-progress | |
working-directory: framework-tests | |
- name: Setup Database | |
run: | | |
php bin/console doctrine:schema:update --force | |
php bin/console doctrine:fixtures:load --quiet | |
working-directory: framework-tests | |
- name: Run tests | |
run: | | |
php vendor/bin/codecept build -c framework-tests | |
php vendor/bin/codecept run Functional -c framework-tests |