Replace github action compose-cache outputs step #275
This file contains 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: tests | |
on: [ push, pull_request ] | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] | |
php-versions: [ '8.1', '8.2', '8.3', '8.4' ] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, intl | |
ini-values: post_max_size=256M, max_execution_time=180 | |
coverage: xdebug | |
tools: php-cs-fixer | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Get composer cache directory | |
uses: mathiasvr/[email protected] | |
id: composer-cache | |
with: | |
run: composer config cache-files-dir | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.stdout }} | |
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer- | |
- name: Install Composer dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Test with PHPUnit | |
if: matrix.php-versions != '8.3' || matrix.operating-system != 'ubuntu-latest' | |
env: | |
XDEBUG_MODE: coverage | |
run: vendor/bin/phpunit --testdox -- tests | |
- name: Test with PHPUnit (coverage) | |
if: matrix.php-versions == '8.3' && matrix.operating-system == 'ubuntu-latest' | |
env: | |
XDEBUG_MODE: coverage | |
run: vendor/bin/phpunit --testdox --coverage-clover coverage.xml -- tests | |
- name: Codecov | |
if: matrix.php-versions == '8.3' && matrix.operating-system == 'ubuntu-latest' | |
uses: codecov/codecov-action@v5 |