Skip to content

Commit

Permalink
Run test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed May 18, 2024
1 parent 87451b8 commit 62989c0
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,50 @@ jobs:

- name: PHPStan
run: phpstan

tests:
runs-on: ubuntu-latest
name: 'PHP ${{ matrix.php }} Illuminate ${{ matrix.illuminate }}'
strategy:
matrix:
php: ['8.1', '8.2', '8.3']
illuminate: ['10', '11']
include:
- illuminate: '10'
testbench: '8'
- illuminate: '11'
testbench: '9'
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 }}-illuminate-${{ matrix.illuminate }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-phpunit-${{ matrix.illuminate }}-composer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Install dependencies
run: |
composer require --no-update \
illuminate/http:^${{ matrix.illuminate }} \
illuminate/support:^${{ matrix.illuminate }} \
orchestra/testbench:^${{ matrix.testbench }}
composer update
- name: Configure PHPUnit
run: "if [ -f './phpunit.${{ matrix.phpunit }}.xml' ]; then cp ./phpunit.${{ matrix.phpunit }}.xml ./phpunit.xml; fi"

- name: PHPUnit
run: ./vendor/bin/phpunit --do-not-cache-result

0 comments on commit 62989c0

Please sign in to comment.