Finetune testing matrix #7
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: automated-testing | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '8.1' | |
- '8.2' | |
os: [ ubuntu-latest ] | |
dependencies: [ lowest, stable, beta ] | |
include: | |
- description: 'beta/RC dependencies' | |
dependencies: beta | |
experimental: true | |
- description: 'PHP upcoming' | |
php: 8.3 | |
experimental: true | |
- description: 'PHP nightly' | |
php: 8.4 | |
experimental: true | |
name: PHP ${{ matrix.php }} ${{ matrix.description }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Allow beta dependencies | |
run: composer config minimum-stability beta | |
if: matrix.dependencies == 'beta' | |
- name: Install dependencies | |
run: composer update ${{ matrix.dependencies == 'lowest' && '--prefer-lowest --prefer-stable' }} | |
- name: Run PHPStan static analysis | |
run: vendor/bin/phpstan | |
if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} | |
- name: Check for dangerous and broken dependencies | |
run: composer audit | |
if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} | |
- name: Run automated tests | |
run: vendor/bin/phpunit --coverage-text | |
- name: Run infection tests | |
run: vendor/bin/infection --threads=max | |
if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} |