Skip to content
Open
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
83 changes: 61 additions & 22 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
schedule:
- cron: '0 0 * * *'

env:
GH_TOKEN: ${{ github.token }}

jobs:
build-assets:
runs-on: ubuntu-latest
Expand All @@ -28,7 +31,7 @@ jobs:

- name: Install PHP dependencies
run: |
composer require "laravel/framework:13.x" --no-interaction --no-update
composer require "laravel/framework:13.x" "orchestra/testbench:^11.0" --no-interaction --no-update
composer update --prefer-dist --no-interaction

- name: Setup Node
Expand Down Expand Up @@ -60,12 +63,9 @@ jobs:
- php: 8.4
laravel: 13.x
stability: prefer-stable
- php: 8.4
laravel: 12.x
stability: prefer-stable
# Dependency floor
- php: 8.3
laravel: 12.x
- php: 8.4
laravel: 13.x
stability: prefer-lowest
# PHP 8.5 (allowed failure)
- php: '8.5'
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:^11.0" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Run PHPStan
Expand All @@ -113,18 +113,25 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.4, 8.3]
laravel: [13.x, 12.x]
php: [8.4]
laravel: [13.x]
stability: [prefer-lowest, prefer-stable]
shard: [1/2, 2/2]
include:
# PHP 8.5 (allowed failure)
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 1/2
allow-failure: true
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 2/2
allow-failure: true
continue-on-error: ${{ matrix.allow-failure || false }}

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - SQLite
name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - SQLite - shard ${{ matrix.shard }}

steps:
- name: Checkout code
Expand All @@ -151,7 +158,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:^11.0" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Download compiled assets
Expand All @@ -164,7 +171,7 @@ jobs:
run: composer build

- name: Execute tests
run: composer test
run: composer test:shard -- --shard=${{ matrix.shard }}

mysql:
runs-on: ubuntu-latest
Expand All @@ -190,18 +197,34 @@ jobs:
- php: 8.4
laravel: 13.x
stability: prefer-stable
shard: 1/2
- php: 8.4
laravel: 13.x
stability: prefer-stable
shard: 2/2
# Dependency floor
- php: 8.3
laravel: 12.x
- php: 8.4
laravel: 13.x
stability: prefer-lowest
shard: 1/2
- php: 8.4
laravel: 13.x
stability: prefer-lowest
shard: 2/2
# PHP 8.5 (allowed failure)
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 1/2
allow-failure: true
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 2/2
allow-failure: true
continue-on-error: ${{ matrix.allow-failure || false }}

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - MySQL 8.0
name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - MySQL 8.0 - shard ${{ matrix.shard }}

steps:
- name: Checkout code
Expand All @@ -228,7 +251,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:^11.0" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Download compiled assets
Expand All @@ -241,7 +264,7 @@ jobs:
run: composer build

- name: Execute tests
run: composer test
run: composer test:shard -- --shard=${{ matrix.shard }}
env:
DB_CONNECTION: mysql
DB_HOST: localhost
Expand Down Expand Up @@ -272,18 +295,34 @@ jobs:
- php: 8.4
laravel: 13.x
stability: prefer-stable
shard: 1/2
- php: 8.4
laravel: 13.x
stability: prefer-stable
shard: 2/2
# Dependency floor
- php: 8.3
laravel: 12.x
- php: 8.4
laravel: 13.x
stability: prefer-lowest
shard: 1/2
- php: 8.4
laravel: 13.x
stability: prefer-lowest
shard: 2/2
# PHP 8.5 (allowed failure)
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 1/2
allow-failure: true
- php: '8.5'
laravel: 13.x
stability: prefer-stable
shard: 2/2
allow-failure: true
continue-on-error: ${{ matrix.allow-failure || false }}

name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - PostgreSQL 15
name: Tests - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - PostgreSQL 15 - shard ${{ matrix.shard }}

steps:
- name: Checkout code
Expand All @@ -310,7 +349,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:^11.0" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Download compiled assets
Expand All @@ -323,7 +362,7 @@ jobs:
run: composer build

- name: Execute tests
run: composer test
run: composer test:shard -- --shard=${{ matrix.shard }}
env:
DB_CONNECTION: pgsql
DB_HOST: localhost
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/tia-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: TIA baseline

on:
push:
branches:
- main
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

env:
GH_TOKEN: ${{ github.token }}

jobs:
baseline:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: pcov

- name: Install dependencies
run: composer install --prefer-dist --no-interaction

- name: Build tests environment
run: composer build

- name: Record TIA baseline
run: vendor/bin/pest --parallel --processes=4 --ci --tia --fresh

- name: Resolve TIA baseline path
id: baseline
run: echo "path=$(vendor/bin/pest --baseline)" >> "$GITHUB_OUTPUT"

- name: Upload TIA baseline
uses: actions/upload-artifact@v4
with:
name: pest-tia-baseline
path: ${{ steps.baseline.outputs.path }}
include-hidden-files: true
retention-days: 30
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"source": "https://github.com/cachethq/core"
},
"require": {
"php": "^8.3",
"php": "^8.4",
"ext-simplexml": "*",
"doctrine/dbal": "^3.6",
"filament/filament": "^5.0",
Expand Down Expand Up @@ -47,11 +47,11 @@
"laravel/boost": "^2.0",
"laravel/pail": "^1.1",
"laravel/pint": "^1.24",
"orchestra/testbench": "^10.0|^11.0",
"pestphp/pest": "^4.3",
"pestphp/pest-plugin-laravel": "^4.0",
"orchestra/testbench": "^11.0",
"pestphp/pest": "^5.0",
"pestphp/pest-plugin-laravel": "^5.0",
"pestphp/pest-plugin-livewire": "*",
"pestphp/pest-plugin-type-coverage": "^4.0",
"pestphp/pest-plugin-type-coverage": "^5.0",
"psalm/plugin-laravel": "^3.14"
},
"minimum-stability": "dev",
Expand Down Expand Up @@ -110,7 +110,9 @@
"test:lint": [
"pint --test"
],
"test:unit": "pest --parallel --processes=10 --ci --compact",
"test:unit": "pest --parallel --processes=4 --ci --compact",
"test:shard": "pest --parallel --processes=4 --ci --compact",
"test:shards": "pest --parallel --processes=4 --ci --update-shards",
"test": [
"@test:unit"
]
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</include>
</source>
<php>
<ini name="memory_limit" value="512M"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
</php>
Expand Down
5 changes: 5 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
use Cachet\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);

pest()->tia()
->locally()
->baselined()
->filtered();
Loading