chore(deps): update actions/cache action to v5.0.4 #45
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
| on: [ push, pull_request ] | |
| name: "CI" | |
| jobs: | |
| qa: | |
| name: "QA (lint + static analysis)" | |
| if: "!startsWith(github.event.head_commit.message, 'chore(release)')" | |
| runs-on: "ubuntu-latest" | |
| env: | |
| PHP_CS_FIXER_IGNORE_ENV: true | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 | |
| - name: "Install PHP" | |
| uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0 | |
| with: | |
| coverage: "none" | |
| php-version: "8.3" | |
| - name: "Validate composer.json and composer.lock" | |
| run: "composer validate --ansi --strict" | |
| - name: "Determine composer cache directory" | |
| uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0 | |
| - name: "Cache dependencies installed with composer" | |
| uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4 | |
| with: | |
| path: "${{ env.COMPOSER_CACHE_DIR }}" | |
| key: "php-8.3-composer-locked-${{ hashFiles('composer.lock') }}" | |
| restore-keys: | | |
| php-8.3-composer-locked-${{ github.ref_name }} | |
| php-8.3-composer-locked- | |
| php-8.3-composer-main | |
| - name: "Install locked dependencies with composer" | |
| uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0 | |
| with: | |
| dependencies: "locked" | |
| - name: "Check coding style" | |
| run: "vendor/bin/codecept build" | |
| - name: "Check coding style" | |
| run: "composer cs:check" | |
| - name: "Run static analysis" | |
| run: "composer stan" | |
| tests: | |
| name: "Run codeception tests" | |
| needs: [ qa ] | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| matrix: | |
| include: | |
| - { php-version: 8.3, dependencies: locked, coverage: pcov, with_coverage: true, allow-fail: false } | |
| - { php-version: 8.4, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true } | |
| - { php-version: 8.5, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true } | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 | |
| - name: "Install PHP" | |
| uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0 | |
| with: | |
| coverage: "${{ matrix.coverage }}" | |
| ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767 | |
| php-version: "${{ matrix.php-version }}" | |
| - name: "Set up problem matchers for PHP" | |
| run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" | |
| - name: "Set up problem matchers for phpunit/phpunit" | |
| run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" | |
| - name: "Validate composer.json and composer.lock" | |
| run: "composer validate --ansi --strict" | |
| - name: "Determine composer cache directory" | |
| uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0 | |
| - name: "Cache dependencies installed with composer" | |
| uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4 | |
| with: | |
| path: "${{ env.COMPOSER_CACHE_DIR }}" | |
| key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | |
| restore-keys: | | |
| php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ github.ref_name }} | |
| php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | |
| php-${{ matrix.php-version }}-composer-main | |
| - name: "Install ${{ matrix.dependencies }} dependencies with composer" | |
| uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0 | |
| with: | |
| dependencies: "${{ matrix.dependencies }}" | |
| - name: "Run Tests (coverage)" | |
| if: matrix.with_coverage == true | |
| run: | | |
| vendor/bin/codecept build | |
| vendor/bin/codecept run --coverage --coverage-xml=coverage.xml --xml --report | |
| - name: "Run Tests" | |
| if: matrix.with_coverage != true | |
| run: | | |
| vendor/bin/codecept build | |
| vendor/bin/codecept run --xml --report | |
| - name: "Upload coverage artifact" | |
| if: matrix.with_coverage == true | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: code-coverage-results | |
| path: tests/_output/ | |
| retention-days: 5 |