Skip to content

Commit 67fefea

Browse files
committed
Update GitHub Actions for Laravel 12
1 parent dda2e5f commit 67fefea

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

Diff for: .github/workflows/main.yml

+39-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ on:
88

99
jobs:
1010
lint:
11+
1112
runs-on: ubuntu-latest
13+
14+
1215
steps:
1316
- name: Checkout code
1417
uses: actions/checkout@v2
1518

19+
1620
- name: Checking for prtodo's.
1721
run: |
1822
if grep --exclude-dir={.git,.github,vendor} -rE "PRtodo"; then
@@ -21,6 +25,7 @@ jobs:
2125
echo "All good"
2226
fi
2327
28+
2429
- name: Checking for leftover "ray" usages.
2530
run: |
2631
if grep --exclude-dir={.git,.github,vendor} -rE "ray("; then
@@ -29,28 +34,35 @@ jobs:
2934
echo "All good"
3035
fi
3136
37+
3238
- name: Setup PHP
3339
uses: shivammathur/setup-php@v2
3440
with:
3541
php-version: 8.3
3642
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3743
coverage: none
3844

45+
3946
- name: Install dependencies
4047
run: |
4148
composer require "laravel/framework:11.*" --no-interaction --no-update
4249
composer install
4350
51+
4452
- name: Execute tests
4553
run: vendor/bin/phpstan
4654

55+
4756
- name: Check code style
4857
run: vendor/bin/phpcs
4958

5059
test:
5160
name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }} - DBAL ${{ matrix.dbal }}
61+
5262
timeout-minutes: 30
63+
5364
runs-on: ${{ matrix.os }}
65+
5466
services:
5567
mysql:
5668
image: mysql:latest
@@ -61,35 +73,43 @@ jobs:
6173
ports:
6274
- 3306/tcp
6375
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
76+
6477
strategy:
6578
fail-fast: false
6679
matrix:
6780
os: [ubuntu-latest]
6881
php: [8.3, 8.2, 8.1]
69-
laravel: [10.*, 11.*]
70-
dbal: [3.*, 4.*]
82+
laravel: ['10.*', '11.*', '12.*']
83+
dbal: ['3.*', '4.*']
7184
exclude:
7285
- laravel: 10.*
7386
dbal: 4.*
7487
- laravel: 11.*
7588
php: 8.1
7689
- laravel: 11.*
7790
dbal: 3.*
91+
- laravel: 12.*
92+
php: 8.1
7893
include:
7994
- laravel: 10.*
8095
testbench: 8.*
8196
- laravel: 11.*
8297
testbench: 9.*
98+
- laravel: 12.*
99+
testbench: 10.*
100+
83101

84102
steps:
85103
- name: Set timezone?
86104
uses: szenius/[email protected]
87105
with:
88-
timezoneLinux: "Europe/Paris"
106+
timezoneLinux: Europe/Paris
107+
89108

90109
- name: Checkout code
91110
uses: actions/checkout@v2
92111

112+
93113
- name: Setup PHP
94114
uses: shivammathur/setup-php@v2
95115
with:
@@ -99,54 +119,66 @@ jobs:
99119
env:
100120
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101121

122+
102123
- name: Setup problem matchers
103124
run: |
104125
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
105126
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
106127
128+
107129
- name: Get Composer Cache Directory
108130
id: composer-cache
109131
run: |
110132
echo "::set-output name=dir::$(composer config cache-files-dir)"
133+
111134
- uses: actions/cache@v2
112135
with:
113136
path: ${{ steps.composer-cache.outputs.dir }}
114137
key: ${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.dbal }}-composer-${{ hashFiles('**/composer.lock') }}
115138
restore-keys: |
116139
${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.dbal }}-composer-
117140
141+
118142
- name: Install dependencies
119143
run: |
120144
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
121145
composer install --prefer-dist --no-interaction --no-plugins
122146
147+
123148
- name: Setup Node.js
124149
uses: actions/setup-node@v1
125150
with:
126-
node-version: '20.x'
151+
node-version: 20.x
152+
127153

128154
- name: Build npm dependencies.
129155
run: |
130156
npm ci
131157
158+
132159
- name: Create blocks dir
133160
run: |
134161
mkdir ./frontend/js/components/blocks/customs
135162
163+
136164
- name: Build twill.
137165
run: ./vendor/bin/testbench twill:build --forTesting
138166
env:
139167
CACHE_STORE: array
140168

169+
141170
- name: Upgrade Chrome
142171
uses: browser-actions/setup-chrome@latest
143172

173+
144174
- name: Upgrade Chrome Driver
145175
run: ./vendor/bin/testbench dusk:chrome-driver --detect
146176

177+
147178
- name: Prepare Testbench Dusk
148179
run: ./vendor/bin/testbench-dusk package:discover
149180

181+
150182
- name: Execute all tests
151183
run: vendor/bin/phpunit --stop-on-error
152184
env:
@@ -156,17 +188,20 @@ jobs:
156188
with:
157189
files: .github/clover.xml
158190

191+
159192
- name: Replace asterisks in Laravel
160193
run: echo "REPLACED_LARAVEL=${MATRIX_LARAVEL//\*/_}" >> $GITHUB_ENV
161194
env:
162195
MATRIX_LARAVEL: ${{ matrix.laravel }}
163196

197+
164198
- name: Replace asterisks in DBAL
165199
id: replace_dbal
166200
run: echo "REPLACED_DBAL=${MATRIX_DBAL//\*/_}" >> $GITHUB_ENV
167201
env:
168202
MATRIX_DBAL: ${{ matrix.dbal }}
169203

204+
170205
- name: Upload artifact
171206
uses: actions/upload-artifact@v4
172207
with:

0 commit comments

Comments
 (0)