88
99jobs :
1010 test :
11- name : Test on PHP ${{ matrix.php }}
11+ name : Test Laravel ${{ matrix.laravel }} on PHP ${{ matrix.php }}
1212 runs-on : ubuntu-latest
1313 continue-on-error : ${{ matrix.experimental == true }}
1414
@@ -17,57 +17,76 @@ jobs:
1717 matrix :
1818 php :
1919 - ' 8.1'
20+ - ' 8.2'
2021 - ' nightly'
2122
23+ laravel :
24+ - ' 8.0'
25+ - ' 9.0'
26+ - ' 10.0'
27+
2228 include :
29+ - php : ' 8.2'
30+ laravel : ' 9.0'
31+ stable : true
2332 - php : ' nightly'
2433 experimental : true
34+ - laravel : ' 8.0'
35+ testbench : ' 6.0'
36+ - laravel : ' 9.0'
37+ testbench : ' 7.0'
38+ - laravel : ' 10.0'
39+ testbench : ' 8.0'
2540
2641 steps :
2742 - name : Checkout
28- uses : actions/checkout@v1
43+ uses : actions/checkout@v3
2944
3045 - name : Setup PHP
31- uses : shivammathur/setup-php@master
46+ uses : shivammathur/setup-php@v2
3247 with :
3348 php-version : ${{ matrix.php }}
3449 extensions : exif,json,mbstring
3550 coverage : pcov
3651
37- - name : Setup problem matchers
38- run : |
39- echo "::add-matcher::${{ runner.tool_cache }}/php.json"
40-
4152 - name : Remove platform from Composer file
4253 run : composer config --unset platform
4354
44- - name : Add GitHub Actions printer for PHPUnit
45- run : composer require --dev --no-update mheap/phpunit-github-actions-printer
55+ - name : Configure to use Laravel ${{ matrix.laravel }} with Testbench ${{ matrix.testbench }}
56+ run : |
57+ composer require --no-update laravel/laravel:^${{ matrix.laravel }}
58+ composer require --no-update --dev orchestra/testbench:^${{ matrix.testbench }}
4659
4760 - name : Configure local Laravel Nova dummy package
4861 run : composer config repositories.0 path ./tests/Fixtures/nova
4962
5063 - name : Install Composer dependencies
51- uses : ramsey/composer-install@v1
64+ uses : ramsey/composer-install@v2
5265 with :
5366 composer-options : " --ignore-platform-req=php"
54- dependency-versions : highest # No lockfile is present, so locked ( the default) isn't possible
67+ dependency-versions : highest # We're installing additional packages, and cannot use the lockfile
5568
56- - name : Lint code
57- run : composer run lint
69+ - name : Run unit tests with coverage and printer
70+ id : phpunit
71+ run : |
72+ echo "phpunit_version=$( vendor/bin/phpunit --version | cut -d ' ' -f 2 )" >> $GITHUB_OUTPUT
73+ vendor/bin/phpunit \
74+ --log-junit ./report-junit.xml \
75+ --coverage-clover ./coverage-clover.xml
5876
59- - name : Run unit tests
60- run :
61- vendor/bin/phpunit
62- --printer mheap\\GithubActionsReporter\\Printer
63- --coverage-clover=./coverage.xml
77+ - name : Report test results
78+ if : ${{ success() || failure() }}
79+ uses : mikepenz/action-junit-report@v3
80+ with :
81+ report_paths : ./report-junit.xml
82+ check_name : Test Results Laravel ${{ matrix.laravel }} on PHP ${{ matrix.php }} with PHPUnit ${{ steps.phpunit.outputs.phpunit_version }}
6483
6584 - name : Determine coverage
66- uses : slavcodev/coverage-monitor-action@1.1 .0
67- if : github.event_name == 'pull_request' && matrix.experimental != true
85+ uses : slavcodev/coverage-monitor-action@1.8 .0
86+ if : ${{ github.event_name == 'pull_request' && matrix.stable == true }}
6887 continue-on-error : true
6988 with :
7089 github_token : ${{ secrets.GITHUB_TOKEN }}
71- clover_file : ./coverage.xml
90+ coverage_path : ./coverage-clover .xml
7291 threshold_alert : 60
7392 threshold_warning : 85
0 commit comments