Update for Laravel 11 #196
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Run unit tests" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
test-laravel: | |
name: Test Laravel ${{ matrix.laravel }} on PHP ${{ matrix.php }} | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental == true }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '8.2' | |
- '8.3' | |
laravel: | |
- '10.0' | |
- '11.0' | |
include: | |
- laravel: '10.0' | |
testbench: '8.0' | |
- laravel: '11.0' | |
testbench: '9.0' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: exif,json,mbstring | |
coverage: pcov | |
- name: Remove platform from Composer file | |
if: ${{ matrix.php }} == 'nightly' | |
run: composer config --unset platform | |
- name: Set platform | |
if: ${{ matrix.php }} != 'nightly' | |
run: composer config platform.php ${{ matrix.php }} | |
- name: Configure to use Laravel ${{ matrix.laravel }} with Testbench ${{ matrix.testbench }} | |
run: | | |
composer require --no-update laravel/laravel:^${{ matrix.laravel }} | |
composer require --no-update --dev orchestra/testbench:^${{ matrix.testbench }} | |
- name: Configure local Laravel Nova dummy package | |
run: composer config repositories.0 path ./tests/Fixtures/nova | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest # We're installing additional packages, and cannot use the lockfile | |
- name: Run unit tests with coverage and printer | |
id: phpunit | |
run: | | |
echo "phpunit_version=$( vendor/bin/phpunit --version | cut -d ' ' -f 2 )" >> $GITHUB_OUTPUT | |
vendor/bin/phpunit \ | |
--log-junit ./report-junit.xml \ | |
--coverage-clover ./coverage-clover.xml | |
- name: Report test results | |
if: ${{ success() || failure() }} | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
report_paths: ./report-junit.xml | |
check_name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }} (PHPUnit ${{ steps.phpunit.outputs.phpunit_version }}) | |
summary: | | |
PHP version: `${{ matrix.php }}` | |
Laravel version: `${{ matrix.laravel }}` | |
Testbench version: `${{ matrix.testbench }}` | |
PHPUnit version: `${{ steps.phpunit.outputs.phpunit_version }}` | |
- name: Determine coverage | |
uses: slavcodev/coverage-monitor-action@1.8.0 | |
if: ${{ github.event_name == 'pull_request' && matrix.stable == true }} | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
coverage_path: ./coverage-clover.xml | |
threshold_alert: 60 | |
threshold_warning: 85 |