Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
180 changes: 92 additions & 88 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,105 @@
name: run-tests

on:
push:
pull_request:
push:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: [12.*, 11.*, 10.*]
dependency-version: [prefer-lowest, prefer-stable]
database: [mysql57, mysql8, pgsql16, pgsql17]
os: [ubuntu-latest]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
exclude:
- php: 8.4
laravel: 10.*
- php: 8.1
laravel: 11.*
- php: 8.1
laravel: 12.*
test:
runs-on: ${{ matrix.os }}

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.database }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.5, 8.1, 8.2, 8.3, 8.4]
laravel: ['10.*', '11.*', '12.*', '13.*']
dependency-version: [prefer-lowest, prefer-stable]
database: [mysql57, mysql8, pgsql16, pgsql17]
os: [ubuntu-latest]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 13.*
testbench: 11.*
exclude:
- php: 8.4
laravel: 10.*
- php: 8.1
laravel: 11.*
- php: 8.1
laravel: 12.*
- laravel: 13.*
php: 8.1
- laravel: 13.*
php: 8.2

services:
mysql57:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel_tags
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.database }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

mysql8:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel_tags
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
services:
mysql57:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel_tags
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mysql8:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel_tags
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
pgsql16:
image: postgres:16
env:
POSTGRES_DB: laravel_tags
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
pgsql17:
image: postgres:17
env:
POSTGRES_DB: laravel_tags
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5433:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3

pgsql16:
image: postgres:16
env:
POSTGRES_DB: laravel_tags
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v6

pgsql17:
image: postgres:17
env:
POSTGRES_DB: laravel_tags
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5433:5432
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, pgsql, pdo_pgsql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, pgsql, pdo_pgsql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: ${{ startsWith(matrix.database, 'mysql') && 'mysql' || 'pgsql' }}
DB_PORT: ${{ matrix.database == 'mysql57' && 3306 || matrix.database == 'mysql8' && 3307 || matrix.database == 'pgsql16' && 5432 || matrix.database == 'pgsql17' && 5433 }}
DB_HOST: 127.0.0.1
DB_USERNAME: ${{ startsWith(matrix.database, 'pgsql') && 'postgres' || 'root' }}
DB_PASSWORD: ${{ startsWith(matrix.database, 'pgsql') && 'postgres' || '' }}
DB_DATABASE: laravel_tags
- name: Execute tests
run: vendor/bin/pest
env:
DB_CONNECTION: ${{ startsWith(matrix.database, 'mysql') && 'mysql' || 'pgsql' }}
DB_PORT: ${{ matrix.database == 'mysql57' && 3306 || matrix.database == 'mysql8' && 3307 || matrix.database == 'pgsql16' && 5432 || matrix.database == 'pgsql17' && 5433 }}
DB_HOST: 127.0.0.1
DB_USERNAME: ${{ startsWith(matrix.database, 'pgsql') && 'postgres' || 'root' }}
DB_PASSWORD: ${{ startsWith(matrix.database, 'pgsql') && 'postgres' || '' }}
DB_DATABASE: laravel_tags
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
],
"require": {
"php": "^8.1",
"laravel/framework": "^10.0|^11.0|^12.0",
"laravel/framework": "^10.0|^11.0|^12.0|^13.0",
"nesbot/carbon": "^2.63|^3.0",
"spatie/eloquent-sortable": "^4.0|^5.0",
"spatie/laravel-package-tools": "^1.4",
"spatie/laravel-translatable": "^6.0"
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0|^10.0",
"pestphp/pest": "^1.22|^2.0",
"phpunit/phpunit": "^9.5.2"
"orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
"pestphp/pest": "^1.22|^2.0|^4.0",
"phpunit/phpunit": "^9.5.2|^12.5.12"
},
"autoload": {
"psr-4": {
Expand Down