Skip to content

Commit 9578223

Browse files
committed
Update GitHub Actions for Laravel 12
1 parent 6dbdc02 commit 9578223

File tree

1 file changed

+137
-92
lines changed

1 file changed

+137
-92
lines changed

.github/workflows/run-tests.yml

Lines changed: 137 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,141 @@
11
name: run-tests
22

3-
on: [ push, pull_request ]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
6-
psalm:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v2
10-
11-
- name: Setup PHP
12-
uses: shivammathur/setup-php@v2
13-
with:
14-
php-version: '8.0'
15-
coverage: none
16-
17-
- name: Validate composer.json and composer.lock
18-
run: composer validate
19-
20-
- name: Install dependencies
21-
run: composer install --no-progress --no-ansi
22-
23-
- name: Run Psalm
24-
run: composer run-script psalm
25-
26-
tests:
27-
runs-on: ubuntu-latest
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
php: [ 8.0, 8.1, 8.2, 8.3 ]
32-
laravel: [ 8.*, 9.*, 10.*, 11.* ]
33-
include:
34-
- laravel: 8.*
35-
testbench: 6.*
36-
- laravel: 9.*
37-
testbench: 7.*
38-
- laravel: 10.*
39-
testbench: 8.*
40-
- laravel: 11.*
41-
testbench: 9.*
42-
exclude:
43-
- php: 8.0
44-
laravel: 10.*
45-
- php: 8.0
46-
laravel: 11.*
47-
- php: 8.1
48-
laravel: 11.*
49-
50-
name: Laravel ${{ matrix.laravel }} with PHP ${{ matrix.php }}
51-
52-
steps:
53-
- name: Checkout code
54-
uses: actions/checkout@v2
55-
56-
- name: Setup PHP
57-
uses: shivammathur/setup-php@v2
58-
with:
59-
php-version: ${{ matrix.php }}
60-
coverage: none
61-
62-
- name: Install dependencies
63-
run: |
64-
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
65-
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
66-
composer update --prefer-dist --no-interaction
67-
68-
- name: Execute tests
69-
run: composer run-script test
70-
71-
72-
coverage:
73-
name: Coverage
74-
needs: [ tests ]
75-
runs-on: ubuntu-latest
76-
steps:
77-
- uses: actions/checkout@v2
78-
- name: Setup PHP
79-
uses: shivammathur/setup-php@v2
80-
with:
81-
php-version: 8.0
82-
coverage: xdebug
83-
84-
- name: Validate composer.json and composer.lock
85-
run: composer validate
86-
87-
- name: Install dependencies
88-
run: composer install --prefer-dist --no-interaction
89-
90-
- name: Run test suite
91-
uses: paambaati/[email protected]
92-
env:
93-
CC_TEST_REPORTER_ID: ${{ secrets.CC_REPORTER_ID }}
94-
with:
95-
coverageCommand: composer run-script test-coverage
96-
coverageLocations: ${{github.workspace}}/coverage.xml:clover
8+
psalm:
9+
10+
runs-on: ubuntu-latest
11+
12+
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.0'
23+
coverage: none
24+
25+
26+
27+
- name: Validate composer.json and composer.lock
28+
run: composer validate
29+
30+
31+
32+
- name: Install dependencies
33+
run: composer install --no-progress --no-ansi
34+
35+
36+
37+
- name: Run Psalm
38+
run: composer run-script psalm
39+
40+
tests:
41+
42+
runs-on: ubuntu-latest
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
php: [8.0, 8.1, 8.2, 8.3]
48+
laravel: ['8.*', '9.*', '10.*', '11.*', '12.*']
49+
include:
50+
- laravel: 8.*
51+
testbench: 6.*
52+
- laravel: 9.*
53+
testbench: 7.*
54+
- laravel: 10.*
55+
testbench: 8.*
56+
- laravel: 11.*
57+
testbench: 9.*
58+
- laravel: 12.*
59+
testbench: 10.*
60+
exclude:
61+
- php: 8.0
62+
laravel: 10.*
63+
- php: 8.0
64+
laravel: 11.*
65+
- php: 8.1
66+
laravel: 11.*
67+
- laravel: 12.*
68+
php: 8.0
69+
- laravel: 12.*
70+
php: 8.1
71+
72+
name: Laravel ${{ matrix.laravel }} with PHP ${{ matrix.php }}
73+
74+
75+
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v2
79+
80+
81+
82+
- name: Setup PHP
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: ${{ matrix.php }}
86+
coverage: none
87+
88+
89+
90+
- name: Install dependencies
91+
run: |
92+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
93+
composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
94+
composer update --prefer-dist --no-interaction
95+
96+
97+
98+
- name: Execute tests
99+
run: composer run-script test
100+
101+
coverage:
102+
103+
name: Coverage
104+
105+
needs:
106+
- tests
107+
108+
runs-on: ubuntu-latest
109+
110+
111+
112+
steps:
113+
- uses: actions/checkout@v2
114+
115+
116+
117+
- name: Setup PHP
118+
uses: shivammathur/setup-php@v2
119+
with:
120+
php-version: 8.0
121+
coverage: xdebug
122+
123+
124+
125+
- name: Validate composer.json and composer.lock
126+
run: composer validate
127+
128+
129+
130+
- name: Install dependencies
131+
run: composer install --prefer-dist --no-interaction
132+
133+
134+
135+
- name: Run test suite
136+
uses: paambaati/[email protected]
137+
env:
138+
CC_TEST_REPORTER_ID: ${{ secrets.CC_REPORTER_ID }}
139+
with:
140+
coverageCommand: composer run-script test-coverage
141+
coverageLocations: ${{github.workspace}}/coverage.xml:clover

0 commit comments

Comments
 (0)