Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ jobs:

runs-on: ${{ matrix.os }}

# Define the matrix of different PHP and dependency versions
# Define the matrix of different PHP, Laravel, and testbench versions
strategy:
# Fail the whole workflow if one of the jobs fails
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.2, 8.3, 8.4 ]
laravel: [12.*, 11.*]
dependency-version: [ prefer-lowest, prefer-stable ]

name: ${{ matrix.os }} / PHP ${{ matrix.php }} / ${{ matrix.dependency-version }}
include:
# Laravel 12 uses Orchestra Testbench 10
- laravel: 12.*
testbench: 10.*
# Laravel 11 uses Orchestra Testbench 9
- laravel: 11.*
testbench: 9.*
name: ${{ matrix.os }} / PHP ${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}

steps:

Expand All @@ -41,7 +48,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

- name: Validate composer.json and composer.lock
run: composer validate --strict
Expand All @@ -51,7 +58,7 @@ jobs:
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -61,14 +68,16 @@ jobs:
# extensions: mbstring, gd, intl

- name: Install dependencies
run: composer update --prefer-dist --no-progress --${{ matrix.dependency-version }}
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/support" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction

- name: Run test suite
run: composer test -- --coverage-clover ./coverage.xml

- name: Upload coverage reports to Codecov
# Make sure the Codecov action is only executed once
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.2' && matrix.dependency-version == 'prefer-stable'
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.2' && matrix.laravel == '12.*' && matrix.dependency-version == 'prefer-stable'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"bezhansalleh/filament-shield": "^3.3",
"datalinx/php-utils": "^2.5",
"filament/filament": "^3.3",
"laravel/framework": "^11.0",
"laravel/framework": "^11.0|^12.0",
"spatie/laravel-package-tools": "^1.19"
},
"require-dev": {
"laravel/pint": "^1.21",
"orchestra/testbench": "^9.9",
"orchestra/testbench": "^9.9|^10.0",
"pestphp/pest": "^3.7",
"pestphp/pest-plugin-livewire": "^3.0"
},
Expand Down