Skip to content

Commit

Permalink
Restore matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed May 16, 2024
1 parent e3f6047 commit 9671dc7
Showing 1 changed file with 79 additions and 43 deletions.
122 changes: 79 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,84 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
checks:
runs-on: ubuntu-latest
name: 'Check'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: pcov
tools: infection, pint, phpstan

- name: Install dependencies
run: composer install

- name: Check platform requirements
run: composer check-platform-reqs

- name: Pint
run: pint --test

- name: Infection
run: infection --min-msi=100

- name: PHPStan
run: phpstan
checks:
runs-on: ubuntu-latest
name: 'Check'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: pcov
tools: infection, pint, phpstan

- name: Install dependencies
run: composer install

- name: Check platform requirements
run: composer check-platform-reqs

- name: Pint
run: pint --test

- name: Infection
run: infection --min-msi=100

- name: PHPStan
run: phpstan
tests:
runs-on: ubuntu-latest
name: 'Test'
strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']
phpunit-versions: ['^9.0', '^10.0', '^11.0']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-versions}}-phpunit-${{ matrix.phpunit-versions }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-versions}}-phpunit-${{ matrix.phpunit-versions }}-composer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
tools: infection, pint, phpstan

- name: Install dependencies
run: |
composer require phpunit/phpunit:${{ matrix.phpunit-versions }} --no-update
composer update
- name: PHPUnit
run: ./vendor/bin/phpunit

0 comments on commit 9671dc7

Please sign in to comment.