Release #44
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: | |
| pull_request: ~ | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| coverage: ['none'] | |
| symfony-versions: | |
| - '6.4.*' | |
| - '7.0.*' | |
| - '8.0.*' | |
| exclude: | |
| - php: '8.1' | |
| symfony-versions: '7.0.*' | |
| - php: '8.1' | |
| symfony-versions: '8.0.*' | |
| - php: '8.2' | |
| symfony-versions: '8.0.*' | |
| - php: '8.3' | |
| symfony-versions: '8.0.*' | |
| include: | |
| - php: '8.4' | |
| coverage: 'xdebug' | |
| symfony-versions: '^7.0' | |
| description: 'Log Code Coverage' | |
| - php: '8.4' | |
| symfony-versions: '8.0.*' | |
| coverage: 'none' | |
| name: PHP ${{ matrix.php }} Symfony ${{ matrix.symfony-versions }} ${{ matrix.description }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache/files | |
| key: ${{ matrix.php }}-${{ matrix.symfony-versions }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: ${{ matrix.coverage }} | |
| - name: Add PHPUnit matcher | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Set composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache composer | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony-versions }}-composer-${{ hashFiles('composer.json') }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony-versions }}-composer | |
| # Pin Symfony for this matrix cell. `composer require` updates the lock in one solve. | |
| # Behat needs the same major for console/translation/yaml as config/di/http-kernel. | |
| # Symfony 8 needs PHP >=8.4 and Behat 4.x-dev (Behat 3 only supports Symfony <=7). | |
| - name: Install dependencies | |
| run: | | |
| set -e | |
| # composer.json may pin platform.php for local lock resolution; CI uses real matrix PHP. | |
| composer config --unset platform.php || true | |
| V="${{ matrix.symfony-versions }}" | |
| if [ -z "$V" ]; then | |
| composer install --no-interaction --prefer-dist | |
| exit 0 | |
| fi | |
| REQ=( | |
| "symfony/config:${V}" | |
| "symfony/console:${V}" | |
| "symfony/dependency-injection:${V}" | |
| "symfony/event-dispatcher:${V}" | |
| "symfony/http-kernel:${V}" | |
| "symfony/translation:${V}" | |
| "symfony/yaml:${V}" | |
| ) | |
| if [[ "$V" == 8.0.* ]]; then | |
| REQ+=("behat/behat:4.x-dev@dev") | |
| fi | |
| composer require "${REQ[@]}" --with-all-dependencies --no-interaction --prefer-dist | |
| - name: Run PHPUnit tests | |
| run: composer phpunit | |
| if: matrix.coverage == 'none' | |
| - name: PHPUnit tests and Log Code coverage | |
| run: ./vendor/bin/phpunit --do-not-fail-on-phpunit-warning --do-not-fail-on-phpunit-deprecation --coverage-clover=coverage.xml | |
| if: matrix.coverage == 'xdebug' | |
| - name: Run codecov | |
| uses: codecov/codecov-action@v4.0.1 | |
| if: matrix.coverage == 'xdebug' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: './coverage.xml' | |
| fail_ci_if_error: false |