Skip to content

[4.x] Fix cross-domain URL detection in multi-domain apps #32458

[4.x] Fix cross-domain URL detection in multi-domain apps

[4.x] Fix cross-domain URL detection in multi-domain apps #32458

Workflow file for this run

name: tests
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.5, 8.4, 8.3]
laravel: [12.*, 11.*]
db: [sqlite, mysql, pgsql]
dependency-version: [prefer-stable]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.5
name: P${{ matrix.php }} - L${{ matrix.laravel }} - DB:${{ matrix.db }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testing
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: testing
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install npm dependencies
run: npm ci
- name: Install Playwright browsers
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npx playwright install --with-deps
- name: Wait for MySQL
if: matrix.db == 'mysql'
run: |
for i in {1..60}; do
nc -z 127.0.0.1 3306 && echo "MySQL is up" && exit 0
echo "Waiting for MySQL ($i) ..." && sleep 2
done
echo "MySQL did not become ready in time" && exit 1
- name: Wait for Postgres
if: matrix.db == 'pgsql'
run: |
for i in {1..60}; do
nc -z 127.0.0.1 5432 && echo "Postgres is up" && exit 0
echo "Waiting for Postgres ($i) ..." && sleep 2
done
echo "Postgres did not become ready in time" && exit 1
- name: Cache Blade views
run: ./vendor/bin/testbench view:cache
- name: Execute tests (parallel)
id: parallel-tests
continue-on-error: true
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --parallel --exclude-group=commands
env:
DB_PASSWORD: password
- name: Execute tests (non-parallel fallback)
if: steps.parallel-tests.outcome == 'failure'
id: non-parallel-tests
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --exclude-group=commands
env:
DB_PASSWORD: password
- name: Warn about parallel test failure
if: steps.parallel-tests.outcome == 'failure' && steps.non-parallel-tests.outcome == 'success'
run: |
echo "::warning::Parallel tests failed but non-parallel tests passed. This may indicate a race condition or test isolation issue."
- name: Execute command tests (serial)
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --group=commands
env:
DB_PASSWORD: password