Use beste/php-cs-fixer-config:^3.1
#17
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: | |
pull_request: | |
paths: | |
- '.github/workflows/tests.yml' | |
- 'src/**' | |
- 'tests/**' | |
- 'composer.json' | |
- 'phpstan.neon.dist' | |
push: | |
branches: ['main'] | |
paths: | |
- '.github/workflows/tests.yml' | |
- 'src/**' | |
- 'tests/**' | |
- 'composer.json' | |
- 'phpstan.neon.dist' | |
workflow_dispatch: | |
jobs: | |
test: | |
name: PHP ${{ matrix.php }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
env: | |
extensions: ctype, dom, intl, json, mbstring, openssl, xml, zip, zlib | |
key: cache-v1 # can be any string, change to clear the extension cache. | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup cache environment | |
id: extcache | |
uses: shivammathur/cache-extensions@v1 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ env.extensions }} | |
key: ${{ env.key }} | |
- name: Cache extensions | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.extcache.outputs.dir }} | |
key: ${{ steps.extcache.outputs.key }} | |
restore-keys: ${{ steps.extcache.outputs.key }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ env.extensions }} | |
tools: composer, pecl | |
coverage: xdebug | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: ramsey/composer-install@v3 | |
with: | |
composer-options: "${{ matrix.composer-options }}" | |
- name: Setup Problem Matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Run PHPStan | |
run: vendor/bin/phpstan | |
- name: Run PHPUnit | |
run: vendor/bin/phpunit --testdox --coverage-text |