-
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (85 loc) · 3.48 KB
/
Copy pathphpunit.yml
File metadata and controls
99 lines (85 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: PHPUnit Tests
on:
push:
branches:
- main
pull_request:
jobs:
# The default dependency set: laravel/framework ^12 || ^13 is installed, so
# the provider's boot() is exercised against a real Illuminate application.
test:
name: PHP ${{ matrix.php-version }} - locked deps
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.3', '8.4', '8.5']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: zip, intl, xdebug
coverage: xdebug
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Run PHPUnit
run: vendor/bin/phpunit --testdox
# Every Laravel major the package claims to support, resolved from scratch.
#
# This job answers "does the suite pass against this dependency set", so it
# runs without a coverage driver. phpunit.xml sets failOnWarning, and PHPUnit
# warns when a coverage driver is missing, so --no-coverage is required here
# rather than optional -- without it the job fails on the warning alone while
# every test passes.
#
# Laravel 10 and 11 use the split illuminate/* packages deliberately: every
# laravel/framework release in those ranges is withheld by Composer's
# security-advisory policy, and the alternative would be disabling that check.
# The advisories do not apply to the split packages, so those majors are still
# exercised here -- they just cannot supply a real Application, and the
# boot() tests skip themselves accordingly.
laravel-majors:
name: Laravel ${{ matrix.laravel }} - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.3', '8.5']
laravel: ['10', '11', '12', '13']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: zip, intl
coverage: none
- name: Pin the Laravel major
run: |
# laravel/framework replaces the illuminate/* split packages, so the
# two cannot both be constrained at once. Drop it for the majors whose
# framework releases are advisory-blocked, and pin it for the rest.
if [ "${{ matrix.laravel }}" -le 11 ]; then
composer remove --dev laravel/framework --no-update --no-interaction
else
composer require --dev "laravel/framework:^${{ matrix.laravel }}.0" \
--no-update --no-interaction
fi
for pkg in support validation filesystem translation config; do
composer require --dev "illuminate/${pkg}:^${{ matrix.laravel }}.0" \
--no-update --no-interaction
done
- name: Resolve dependencies
run: |
composer update --with-all-dependencies \
--prefer-dist --no-progress --no-interaction
- name: Show what actually resolved
# illuminate/support is not separately installed when laravel/framework
# is present -- the framework replaces it -- so list whichever is there.
run: composer show | grep -E '^(laravel/framework|illuminate/support) ' || true
- name: Run PHPUnit
run: vendor/bin/phpunit --testdox --no-coverage