Allow execution via PHPUnit #729
Workflow file for this run
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: CI | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: ["8.2", "8.5"] | |
| symfony: ["5.4", "6.4", "7.4", "8.0"] | |
| exclude: | |
| - php: "8.2" | |
| symfony: "8.0" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: pcov | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/composer | |
| key: php-${{ matrix.php }}-sf-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: php-${{ matrix.php }}-sf-${{ matrix.symfony }}- | |
| - uses: actions/checkout@v6 | |
| name: Checkout Symfony ${{ matrix.symfony }} app | |
| with: | |
| repository: Codeception/symfony-module-tests | |
| path: framework-tests | |
| ref: ${{ matrix.symfony }} | |
| - name: Install dependencies | |
| run: | | |
| sed -i "s/\^5.4 | \^6.4 | \^7.4 | \^8.0/${{ matrix.symfony }}.*/g" composer.json | |
| composer install --prefer-dist --no-progress | |
| - name: Quality checks | |
| if: matrix.symfony == '8.0' | |
| run: composer validate --strict && composer audit && composer cs-check && composer phpstan | |
| - name: Run module tests | |
| run: vendor/bin/phpunit tests ${{ matrix.symfony == '8.0' && '--coverage-text --coverage-filter src' || '' }} | |
| - name: Prepare Symfony app & run tests | |
| run: | | |
| composer -d framework-tests remove codeception/module-symfony --dev --no-update | |
| composer -d framework-tests install --no-progress | |
| php framework-tests/bin/console doctrine:schema:update --force | |
| php framework-tests/bin/console doctrine:fixtures:load --quiet | |
| php vendor/bin/codecept run Functional -c framework-tests | |
| if [ "${{ matrix.symfony }}" = "7.4" ]; then | |
| composer require codeception/module-rest --dev | |
| git -C framework-tests apply resetFormatsAfterRequest_issue_test.patch | |
| composer -d framework-tests install --no-progress | |
| php framework-tests/bin/console lexik:jwt:generate-keypair --skip-if-exists | |
| php vendor/bin/codecept run Functional -c framework-tests | |
| fi |