diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 4a1f073..3a1e3b5 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -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: @@ -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 @@ -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 @@ -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 }} diff --git a/composer.json b/composer.json index 8fa8245..e866f8c 100644 --- a/composer.json +++ b/composer.json @@ -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" },