Skip to content

Replace kernel reboot with actual boot to reset services #683

Replace kernel reboot with actual boot to reset services

Replace kernel reboot with actual boot to reset services #683

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.2, 8.3, 8.4]
symfony: ["5.4.*", "6.4.*", "6.4wApi", "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
env:
MATRIX_SYMFONY: ${{ matrix.symfony }}
run: |
if [[ "$MATRIX_SYMFONY" == *'*' ]]; then
echo "SF_REF=${MATRIX_SYMFONY%.*}" >> "$GITHUB_ENV"
else
echo "SF_REF=$MATRIX_SYMFONY" >> "$GITHUB_ENV"
fi
- name: Set Composer Symfony constraint
env:
MATRIX_SYMFONY: ${{ matrix.symfony }}
run: |
if [[ "$MATRIX_SYMFONY" == "6.4wApi" ]]; then
echo "COMP_SYMFONY=6.4.*" >> "$GITHUB_ENV"
else
echo "COMP_SYMFONY=$MATRIX_SYMFONY" >> "$GITHUB_ENV"
fi
- 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
env:
MATRIX_SYMFONY: ${{ matrix.symfony }}
run: |
composer require symfony/finder=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/yaml=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/console=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/event-dispatcher=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/css-selector=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/dom-crawler=${{ env.COMP_SYMFONY }} --no-update
composer require symfony/browser-kit=${{ env.COMP_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
if [[ "$MATRIX_SYMFONY" == "6.4wApi" ]]; then
composer require codeception/module-rest="3.*" --no-update
fi
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: Generate JWT keypair
if: ${{ matrix.symfony == '6.4wApi' }}
run: php bin/console lexik:jwt:generate-keypair --skip-if-exists
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