Skip to content

Update composer.lock #34598

Update composer.lock

Update composer.lock #34598

Workflow file for this run

name: tests
on:
push:
pull_request:
permissions:
contents: read
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: [13.*, 12.*, 11.*]
db: [sqlite]
dependency-version: [prefer-stable]
include:
- laravel: 13.*
testbench: 11.*
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
- php: 8.5
laravel: 13.*
testbench: 11.*
db: mysql
dependency-version: prefer-stable
- php: 8.5
laravel: 13.*
testbench: 11.*
db: pgsql
dependency-version: prefer-stable
- php: 8.5
laravel: 12.*
testbench: 10.*
db: mysql
dependency-version: prefer-stable
- php: 8.5
laravel: 12.*
testbench: 10.*
db: pgsql
dependency-version: prefer-stable
- php: 8.4
laravel: 11.*
testbench: 9.*
db: mysql
dependency-version: prefer-stable
- php: 8.4
laravel: 11.*
testbench: 9.*
db: pgsql
dependency-version: prefer-stable
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Cache Composer dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.composer/cache/files
key: composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ matrix.php }}-${{ matrix.laravel }}-
composer-${{ matrix.php }}-
- name: Set up PHP
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: npm
- name: Install npm dependencies
run: npm ci --ignore-scripts
- name: Install Chromium system dependencies
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libnss3 libatk-bridge2.0-0 libdrm2 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2t64
- name: Cache Playwright Chromium
id: playwright-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: npx playwright install chromium
- 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: Retry tests (parallel, attempt 2)
if: steps.parallel-tests.outcome == 'failure'
id: parallel-retry-2
continue-on-error: true
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --parallel --bail --exclude-group=commands
env:
DB_PASSWORD: password
- name: Retry tests (parallel, attempt 3)
if: steps.parallel-retry-2.outcome == 'failure'
id: parallel-retry-3
continue-on-error: true
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --parallel --bail --exclude-group=commands
env:
DB_PASSWORD: password
- name: Retry tests (parallel, attempt 4)
if: steps.parallel-retry-3.outcome == 'failure'
id: parallel-retry-4
continue-on-error: true
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --parallel --bail --exclude-group=commands
env:
DB_PASSWORD: password
- name: Retry tests (parallel, attempt 5)
if: steps.parallel-retry-4.outcome == 'failure'
id: parallel-retry-5
run: ./vendor/bin/pest --configuration=phpunit.${{ matrix.db }}.xml --parallel --bail --exclude-group=commands
env:
DB_PASSWORD: password
- name: Warn about flaky tests
if: steps.parallel-tests.outcome == 'failure' && (steps.parallel-retry-2.outcome == 'success' || steps.parallel-retry-3.outcome == 'success' || steps.parallel-retry-4.outcome == 'success' || steps.parallel-retry-5.outcome == 'success')
run: |
echo "::warning::Parallel tests failed but a retry 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