Skip to content

Commit 559754a

Browse files
committed
Update GitHub Actions for Laravel 12
1 parent ef11129 commit 559754a

File tree

2 files changed

+90
-88
lines changed

2 files changed

+90
-88
lines changed

.github/workflows/pest.yml

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,82 @@
11
name: Tests
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
88

99
jobs:
10-
test:
11-
name: Pest - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - DB ${{ matrix.db }} ${{ matrix.dependency-version }}
10+
test:
11+
name: Pest - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - DB ${{ matrix.db }} ${{ matrix.dependency-version }}
1212

13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-latest
1414

15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
php: [ 8.3, 8.2, 8.1 ]
19-
laravel: [ 11.*, 10.* ]
20-
db: [ 'mysql:8.0', 'mysql:5.7', 'mariadb:10.11', 'postgis/postgis:16-3.4', 'postgis/postgis:15-3.4', 'postgis/postgis:14-3.4', 'postgis/postgis:13-3.4', 'postgis/postgis:12-3.4' ]
21-
dependency-version: [ prefer-stable ]
22-
include:
23-
- laravel: 10.*
24-
testbench: ^8.0
25-
- laravel: 11.*
26-
testbench: ^9.0
27-
exclude:
28-
- laravel: 11.*
29-
php: 8.1
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php: [8.3, 8.2, 8.1]
19+
laravel: ['10.*', '11.*', '12.*']
20+
db: ['mysql:8.0', 'mysql:5.7', 'mariadb:10.11', 'postgis/postgis:16-3.4', 'postgis/postgis:15-3.4', 'postgis/postgis:14-3.4', 'postgis/postgis:13-3.4', 'postgis/postgis:12-3.4']
21+
dependency-version: [prefer-stable]
22+
include:
23+
- laravel: 10.*
24+
testbench: ^8.0
25+
- laravel: 11.*
26+
testbench: ^9.0
27+
- laravel: 12.*
28+
testbench: ^10.0
29+
exclude:
30+
- laravel: 11.*
31+
php: 8.1
32+
- laravel: 12.*
33+
php: 8.1
3034

31-
services:
32-
db:
33-
image: ${{ matrix.db }}
34-
env:
35-
MYSQL_ALLOW_EMPTY_PASSWORD: yes
36-
MYSQL_DATABASE: laravel_eloquent_spatial_test
37-
POSTGRES_DB: laravel_eloquent_spatial_test
38-
POSTGRES_USER: root
39-
POSTGRES_HOST_AUTH_METHOD: trust
40-
ports:
41-
- ${{ contains(matrix.db, 'postgis') && '5432' || '3306' }}
42-
options: >-
43-
${{ (contains(matrix.db, 'postgis') && '--health-cmd="pg_isready"') || '--health-cmd="mysqladmin ping"' }}
44-
--health-interval=10s --health-timeout=5s --health-retries=3
35+
services:
36+
db:
37+
image: ${{ matrix.db }}
38+
env:
39+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
40+
MYSQL_DATABASE: laravel_eloquent_spatial_test
41+
POSTGRES_DB: laravel_eloquent_spatial_test
42+
POSTGRES_USER: root
43+
POSTGRES_HOST_AUTH_METHOD: trust
44+
ports:
45+
- ${{ contains(matrix.db, 'postgis') && '5432' || '3306' }}
46+
options: ${{ (contains(matrix.db, 'postgis') && '--health-cmd="pg_isready"') || '--health-cmd="mysqladmin ping"' }} --health-interval=10s --health-timeout=5s --health-retries=3
4547

46-
steps:
47-
- name: Checkout code
48-
uses: actions/checkout@v2
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v2
4951

50-
- name: Setup PHP
51-
uses: shivammathur/setup-php@v2
52-
with:
53-
php-version: ${{ matrix.php }}
54-
coverage: none
52+
- name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
coverage: none
5557

56-
- name: Install dependencies
57-
run: |
58-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
59-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
58+
- name: Install dependencies
59+
run: |
60+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
61+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
6062
61-
- name: Set DB_CONNECTION env variable (PostGIS)
62-
if: contains(matrix.db, 'postgis')
63-
run: |
64-
echo "DB_CONNECTION=pgsql" >> "$GITHUB_ENV"
63+
- name: Set DB_CONNECTION env variable (PostGIS)
64+
if: "contains(matrix.db, 'postgis')"
65+
run: |
66+
echo "DB_CONNECTION=pgsql" >> "$GITHUB_ENV"
6567
66-
- name: Set DB_CONNECTION env variable (MariaDB & Laravel 11)
67-
if: contains(matrix.laravel, '11') && contains(matrix.db, 'mariadb')
68-
run: |
69-
echo "DB_CONNECTION=mariadb" >> "$GITHUB_ENV"
68+
- name: Set DB_CONNECTION env variable (MariaDB & Laravel 11)
69+
if: "contains(matrix.laravel, '11') && contains(matrix.db, 'mariadb')"
70+
run: |
71+
echo "DB_CONNECTION=mariadb" >> "$GITHUB_ENV"
7072
71-
- name: Set DB_COLLATION env variable (Mysql 5.7 & Laravel 11)
72-
if: contains(matrix.laravel, '11') && contains(matrix.db, 'mysql:5.7')
73-
run: |
74-
echo "DB_COLLATION=utf8mb4_unicode_ci" >> "$GITHUB_ENV"
73+
- name: Set DB_COLLATION env variable (Mysql 5.7 & Laravel 11)
74+
if: "contains(matrix.laravel, '11') && contains(matrix.db, 'mysql:5.7')"
75+
run: |
76+
echo "DB_COLLATION=utf8mb4_unicode_ci" >> "$GITHUB_ENV"
7577
76-
- name: Execute tests
77-
env:
78-
DB_PORT: ${{ job.services.db.ports[contains(matrix.db, 'postgis') && '5432' || '3306'] }}
79-
DB_CONNECTION: ${{ env.DB_CONNECTION || 'mysql' }}
80-
run: vendor/bin/pest
78+
- name: Execute tests
79+
env:
80+
DB_PORT: ${{ job.services.db.ports[contains(matrix.db, 'postgis') && '5432' || '3306'] }}
81+
DB_CONNECTION: ${{ env.DB_CONNECTION || 'mysql' }}
82+
run: vendor/bin/pest

.github/workflows/phpstan.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
name: Static code analysis
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
88

99
jobs:
10-
phpstan:
11-
name: PHPStan
10+
phpstan:
11+
name: PHPStan
1212

13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-latest
1414

15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
php: [ 8.3, 8.2 ]
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php: [8.3, 8.2]
1919

20-
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
2323

24-
- name: Setup PHP
25-
uses: shivammathur/setup-php@v2
26-
with:
27-
php-version: ${{ matrix.php }}
28-
coverage: none
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: none
2929

30-
- name: Install dependencies
31-
run: composer install --prefer-dist --no-interaction
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-interaction
3232

33-
- name: Run PHPStan
34-
run: ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github
33+
- name: Run PHPStan
34+
run: ./vendor/bin/phpstan analyse --memory-limit=2G --error-format=github

0 commit comments

Comments
 (0)