build(deps): Bump actions/cache from 5.0.1 to 5.0.2 in /.github/workf… #76
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
| # yamllint disable rule:line-length | |
| # yamllint disable rule:braces | |
| name: Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| SYMFONY_REQUIRE: ${{ matrix.symfony-require }} | |
| strategy: | |
| matrix: | |
| php-version: [ '8.2', '8.3', '8.4', '8.5' ] | |
| coverage-driver: [ pcov ] | |
| symfony-require: | |
| - '6.4.*' | |
| - '7.4.*' | |
| exclude: | |
| - php-version: '8.1' | |
| symfony-require: '^7' | |
| name: Unit tests on PHP ${{ matrix.php-version }} with Symfony ${{ matrix.symfony-require }} (${{ matrix.coverage-driver }}) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| coverage: ${{ matrix.coverage-driver }} | |
| tools: composer:v2, flex | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
| - name: Cache dependencies | |
| uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ hashFiles('composer.*') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.symfony-require }}- | |
| composer-${{ runner.os }}-${{ matrix.php-version }}- | |
| composer-${{ runner.os }}- | |
| composer- | |
| - name: Configure Symfony Flex | |
| run: composer config extra.symfony.require ${{ matrix.symfony-require }} | |
| - name: Install dependencies | |
| run: composer update --optimize-autoloader --no-interaction --no-progress --prefer-dist | |
| - name: Run tests and generate coverage | |
| run: make test-unit | |
| - name: Upload coverage results to Coveralls | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: vendor/bin/php-coveralls | |
| e2e: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-version: [ '8.2', '8.3', '8.4' ] # TODO: add PHP 8.5 | |
| coverage-driver: [ pcov ] | |
| name: End-to-end with PHP ${{ matrix.php-version }} (${{ matrix.coverage-driver }}) | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| coverage: ${{ matrix.coverage-driver }} | |
| tools: composer:v2 | |
| - name: Run E2E tests | |
| env: | |
| TERM: xterm-256color | |
| run: make test-e2e | |
| # This is a meta job to avoid to have to constantly change the protection rules | |
| # whenever we touch the matrix. | |
| tests-status: | |
| name: Tests Status | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: | |
| - tests | |
| - e2e | |
| if: always() | |
| steps: | |
| - name: Successful run | |
| if: ${{ !(contains(needs.*.result, 'failure')) }} | |
| run: exit 0 | |
| - name: Failing run | |
| if: ${{ contains(needs.*.result, 'failure') }} | |
| run: exit 1 |