Skip to content

Commit

Permalink
Testing out matrix of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkelso committed Feb 19, 2024
1 parent 79fa6f5 commit b562356
Show file tree
Hide file tree
Showing 15 changed files with 525 additions and 369 deletions.
57 changes: 25 additions & 32 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,28 @@ name: run-tests
on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1]
dependency-version: [prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

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

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1]
phpunit: [9.6, 10.0, 11.0]
dependency-version: [prefer-stable]
exclude:
- php: 8.1
phpunit: 11.0

name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
version: ${{ matrix.phpunit }}
php_version: ${{ matrix.php }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": ">=8.1",
"phpunit/phpunit": ">=10.0",
"phpunit/phpunit": ">=9.6",
"ext-json": "*",
"blastcloud/chassis": "^1.0.6",
"symfony/http-client": ">=6.0"
Expand Down
Loading

0 comments on commit b562356

Please sign in to comment.