Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update GitHub Actions for Laravel 12
  • Loading branch information
laravel-shift committed Feb 17, 2025
commit 375f226f93e06924792503e8085e70abbf2e1d11
28 changes: 15 additions & 13 deletions .github/workflows/run-stub-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: run-stub-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
stub-test:
Expand All @@ -11,7 +13,7 @@ jobs:
matrix:
os: [ubuntu-22.04, windows-latest]
php: [8.4, 8.3, 8.2]
laravel: [11.0, 10.2]
laravel: [10.2, 11.0, '12.0']
exclude:
- php: 8.4
laravel: 10.0
Expand All @@ -33,17 +35,17 @@ jobs:

- name: Remove installed Splade (Unix)
run: rm -rf vendor/protonemedia/laravel-splade
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Remove installed Splade (Windows)
run: rd "vendor/protonemedia/laravel-splade" /s /q
shell: cmd
if: matrix.os == 'windows-latest'
if: "matrix.os == 'windows-latest'"

- name: Checkout code
uses: actions/[email protected]
with:
path: "vendor/protonemedia/laravel-splade"
path: vendor/protonemedia/laravel-splade

- name: Install Splade
run: |
Expand All @@ -59,47 +61,47 @@ jobs:
run: |
rm -rf node_modules/@protonemedia/laravel-splade/dist
cp -R vendor/protonemedia/laravel-splade/dist node_modules/@protonemedia/laravel-splade/
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Remove installed Splade and copy front-end build from Checkout (Windows)
run: |
rd "node_modules/@protonemedia/laravel-splade/dist" /s /q
mkdir "node_modules/@protonemedia/laravel-splade/dist"
xcopy "vendor/protonemedia/laravel-splade/dist" "node_modules/@protonemedia/laravel-splade/dist" /E /I
shell: cmd
if: matrix.os == 'windows-latest'
if: "matrix.os == 'windows-latest'"

- name: Compile assets
run: npm run build

- name: Run Laravel Server (Unix)
run: php artisan serve &
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Run Test (Unix)
run: php vendor/protonemedia/laravel-splade/TestStubs.php
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Run Laravel Server (Windows) and Run Test
run: |
start /b cmd /v:on /c "(php artisan serve) &"
php vendor/protonemedia/laravel-splade/TestStubs.php
shell: cmd
if: matrix.os == 'windows-latest'
if: "matrix.os == 'windows-latest'"

- name: Start SSR server (Unix)
run: |
echo "SPLADE_SSR_ENABLED=true" >> .env
node bootstrap/ssr/ssr.js &
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Run Test command (Unix)
run: php artisan splade:ssr-test
if: matrix.os == 'ubuntu-22.04'
if: "matrix.os == 'ubuntu-22.04'"

- name: Start SSR server (Windows) and Run Test command
run: |
echo "SPLADE_SSR_ENABLED=true" >> .env
node bootstrap/ssr/ssr.js &
php artisan splade:ssr-test
if: matrix.os == 'windows-latest'
if: "matrix.os == 'windows-latest'"
34 changes: 19 additions & 15 deletions .github/workflows/run-table-tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: run-table-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
table-test:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.4, 8.3, 8.2]
laravel: [11.0, 10.0]
laravel: [10.0, 11.0, '12.0']
db: [mysql, postgres, sqlite]
ssr: [true, false]
dependency-version: [prefer-lowest, prefer-stable]
Expand All @@ -18,6 +21,8 @@ jobs:
testbench: 9.*
- laravel: 10.0
testbench: 8.*
- laravel: '12.0'
testbench: 10.*
exclude:
- dependency-version: prefer-lowest
ssr: true
Expand Down Expand Up @@ -68,20 +73,19 @@ jobs:
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
- if: "${{ steps.cache-npm.outputs.cache-hit == 'false' }}"
name: List the state of node modules
continue-on-error: true
run: npm list

- name: "Install locked dependencies with npm"
- name: Install locked dependencies with npm
run: |
npm ci --ignore-scripts

Expand All @@ -99,19 +103,19 @@ jobs:
coverage: none

- name: Prepare environment file (MySQL)
if: ${{ matrix.db == 'mysql' }}
if: "${{ matrix.db == 'mysql' }}"
run: |
cd app
cp .env.example.mysql .env

- name: Prepare environment file (PostgreSQL)
if: ${{ matrix.db == 'postgres' }}
if: "${{ matrix.db == 'postgres' }}"
run: |
cd app
cp .env.example.postgres .env

- name: Prepare environment file (SQLite)
if: ${{ matrix.db == 'sqlite' }}
if: "${{ matrix.db == 'sqlite' }}"
run: |
cd app
cp .env.example .env
Expand Down Expand Up @@ -140,15 +144,15 @@ jobs:
cd app
sed -i -e "s|SPLADE_SSR_ENABLED=false|SPLADE_SSR_ENABLED=true|g" .env
node bootstrap/ssr/ssr.mjs &
if: matrix.ssr == true
if: 'matrix.ssr == true'

- name: Migrate DB and Run Laravel Server (MySQL)
run: |
cd app
php artisan storage:link
php artisan migrate:fresh --seed
php artisan serve &
if: ${{ matrix.db == 'mysql' }}
if: "${{ matrix.db == 'mysql' }}"
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}

Expand All @@ -158,20 +162,20 @@ jobs:
php artisan storage:link
php artisan migrate:fresh --seed
php artisan serve &
if: ${{ matrix.db == 'postgres' }}
if: "${{ matrix.db == 'postgres' }}"
env:
DB_PORT: ${{ job.services.postgres.ports[5432] }}

- name: Migrate DB and Run Laravel Server (SQLite)
if: ${{ matrix.db == 'sqlite' }}
if: "${{ matrix.db == 'sqlite' }}"
run: |
cd app
php artisan storage:link
php artisan migrate:fresh --seed
php artisan serve &

- name: Execute Dusk tests (only table tests - MySQL)
if: ${{ matrix.db == 'mysql' }}
if: "${{ matrix.db == 'mysql' }}"
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
Expand All @@ -182,7 +186,7 @@ jobs:
DB_PORT: ${{ job.services.mysql.ports[3306] }}

- name: Execute Dusk tests (only table tests - PostgreSQL)
if: ${{ matrix.db == 'postgres' }}
if: "${{ matrix.db == 'postgres' }}"
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
Expand All @@ -193,7 +197,7 @@ jobs:
DB_PORT: ${{ job.services.postgres.ports[5432] }}

- name: Execute Dusk tests (only table tests - SQLite)
if: ${{ matrix.db == 'sqlite' }}
if: "${{ matrix.db == 'sqlite' }}"
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
name: run-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.4, 8.3, 8.2]
laravel: [11.0, 10.0]
laravel: [10.0, 11.0, '12.0']
ssr: [true, false]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 11.0
testbench: 9.*
- laravel: 10.0
testbench: 8.*
- laravel: '12.0'
testbench: 10.*
exclude:
- ssr: true
dependency-version: prefer-lowest
Expand All @@ -39,20 +44,19 @@ jobs:
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
- if: "${{ steps.cache-npm.outputs.cache-hit == 'false' }}"
name: List the state of node modules
continue-on-error: true
run: npm list

- name: "Install locked dependencies with npm"
- name: Install locked dependencies with npm
run: |
npm ci --ignore-scripts

Expand Down Expand Up @@ -83,15 +87,15 @@ jobs:
php artisan migrate:fresh --seed

- name: Prepare L10
if: ${{ matrix.laravel == '10.0' }}
if: "${{ matrix.laravel == '10.0' }}"
run: |
cd app
rm composer.lock
composer require illuminate/contracts:^10.48.2 spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.4 nunomaduro/collision:^7.10 --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Prepare L11
if: ${{ matrix.laravel == '11.0' }}
if: "${{ matrix.laravel == '11.0' }}"
run: |
cd app
rm composer.lock
Expand Down Expand Up @@ -119,7 +123,7 @@ jobs:
cd app
sed -i -e "s|SPLADE_SSR_ENABLED=false|SPLADE_SSR_ENABLED=true|g" .env
node bootstrap/ssr/ssr.mjs &
if: matrix.ssr == true
if: 'matrix.ssr == true'

- name: Run Laravel Server
run: |
Expand Down
Loading