Skip to content

Commit 8feb781

Browse files
committed
Update GitHub Actions for Laravel 12
1 parent 01bb302 commit 8feb781

File tree

1 file changed

+66
-68
lines changed

1 file changed

+66
-68
lines changed

.github/workflows/run-tests.yml

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,80 @@
11
name: run-tests
22

33
on:
4-
push:
5-
paths:
6-
- '**.php'
7-
- '.github/workflows/run-tests.yml'
8-
- 'phpunit.xml.dist'
9-
- 'composer.json'
10-
- 'composer.lock'
4+
push:
5+
paths:
6+
- **.php
7+
- .github/workflows/run-tests.yml
8+
- phpunit.xml.dist
9+
- composer.json
10+
- composer.lock
1111

1212
jobs:
13-
test:
14-
runs-on: ${{ matrix.os }}
15-
timeout-minutes: 5
16-
strategy:
17-
fail-fast: true
18-
matrix:
19-
os: [ubuntu-latest]
20-
php: [8.3, 8.2]
21-
laravel: [10.*, 11.*]
22-
stability: [prefer-stable]
23-
include:
24-
- laravel: 11.*
25-
testbench: 9.*
26-
carbon: ^2.63
27-
- laravel: 10.*
28-
testbench: 8.*
13+
test:
14+
runs-on: ${{ matrix.os }}
2915

30-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
16+
timeout-minutes: 5
3117

32-
services:
33-
mysql:
34-
image: mysql:8.0
35-
env:
36-
MYSQL_USER: user
37-
MYSQL_PASSWORD: secret
38-
MYSQL_DATABASE: laravel_query_builder
39-
MYSQL_ROOT_PASSWORD: secretroot
40-
ports:
41-
- 3306
42-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os: [ubuntu-latest]
22+
php: [8.3, 8.2]
23+
laravel: ['10.*', '11.*', '12.*']
24+
stability: [prefer-stable]
25+
include:
26+
- laravel: 11.*
27+
testbench: 9.*
28+
carbon: ^2.63
29+
- laravel: 10.*
30+
testbench: 8.*
31+
- laravel: 12.*
32+
testbench: 10.*
4333

44-
redis:
45-
image: redis
46-
ports:
47-
- 6379:6379
48-
options: >-
49-
--health-cmd "redis-cli ping"
50-
--health-interval 10s
51-
--health-timeout 5s
52-
--health-retries 5
34+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
5335

54-
steps:
55-
- name: Checkout code
56-
uses: actions/checkout@v4
36+
services:
37+
mysql:
38+
image: mysql:8.0
39+
env:
40+
MYSQL_USER: user
41+
MYSQL_PASSWORD: secret
42+
MYSQL_DATABASE: laravel_query_builder
43+
MYSQL_ROOT_PASSWORD: secretroot
44+
ports:
45+
- 3306
46+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
47+
redis:
48+
image: redis
49+
ports:
50+
- 6379:6379
51+
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
5752

58-
- name: Setup PHP
59-
uses: shivammathur/setup-php@v2
60-
with:
61-
php-version: ${{ matrix.php }}
62-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
63-
coverage: none
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
6456

65-
- name: Setup problem matchers
66-
run: |
67-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
68-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
57+
- name: Setup PHP
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: ${{ matrix.php }}
61+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
62+
coverage: none
6963

70-
- name: Install dependencies
71-
run: |
72-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
73-
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
64+
- name: Setup problem matchers
65+
run: |
66+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
67+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
7468
75-
- name: Execute tests
76-
run: vendor/bin/pest
77-
env:
78-
DB_USERNAME: user
79-
DB_PASSWORD: secret
80-
DB_PORT: ${{ job.services.mysql.ports[3306] }}
81-
REDIS_PORT: 6379
69+
- name: Install dependencies
70+
run: |
71+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
72+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
8273
74+
- name: Execute tests
75+
run: vendor/bin/pest
76+
env:
77+
DB_USERNAME: user
78+
DB_PASSWORD: secret
79+
DB_PORT: ${{ job.services.mysql.ports[3306] }}
80+
REDIS_PORT: 6379

0 commit comments

Comments
 (0)