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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 12 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
# Keep development files out of the Composer package. docs, llms.txt and
# resources/boost ship with it, for AI assistants and Laravel Boost.
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.github export-ignore
/.editorconfig export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/pint.json export-ignore
/tests export-ignore
/.editorconfig export-ignore
/AGENTS.md export-ignore
/CLAUDE.md export-ignore
/node_modules export-ignore
/package.json export-ignore
/pnpm-lock.yaml export-ignore
/tsconfig.json export-ignore
/vitest.config.ts export-ignore
20 changes: 0 additions & 20 deletions .github/coverage.svg

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/run-tests.yml

This file was deleted.

179 changes: 179 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: tests

on:
pull_request:
push:
branches:
- main
- next-gen

# The unreleased javaabu/* dependencies come from VCS repositories; the job's own
# token keeps Composer within GitHub's API limits
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ github.token }}"}}'

jobs:
pint:
runs-on: ubuntu-latest

name: Pint

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: none

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer downloads
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-${{ hashFiles('composer.json', 'composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-
composer-${{ runner.os }}-${{ github.job }}-

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Check code style
run: vendor/bin/pint --test

js:
runs-on: ubuntu-latest

name: React pages (typecheck, tests)

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 22
package-manager-cache: false

# The default store is inside a node_modules folder, which breaks the declaration
# build of @javaabu/forms (installed from git and built on install): Javaabu/react-forms#20
- name: Install dependencies
run: pnpm install --frozen-lockfile --store-dir "$RUNNER_TEMP/pnpm-store"

- name: Typecheck
run: pnpm typecheck

- name: Test
run: pnpm test

without-optional:
runs-on: ubuntu-latest

name: Without the optional packages

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: curl, mbstring, zip, pdo, sqlite, pdo_sqlite
coverage: none

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer downloads
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-${{ hashFiles('composer.json', 'composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-
composer-${{ runner.os }}-${{ github.job }}-

- name: Install dependencies without Inertia, Sanctum, Passport and activitylog
run: |
composer remove --dev inertiajs/inertia-laravel laravel/sanctum laravel/passport spatie/laravel-activitylog --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --exclude-group optional

tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [ 8.4, 8.5 ]
laravel: [ 12.*, 13.* ]
stability: [ prefer-lowest, prefer-stable ]
include:
- laravel: 12.*
testbench: 10.*
- laravel: 13.*
testbench: 11.*

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

env:
COVERAGE: ${{ matrix.php == '8.4' && matrix.laravel == '13.*' && matrix.stability == 'prefer-stable' }}

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: ${{ env.COVERAGE == 'true' && 'pcov' || 'none' }}

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: Cache Composer downloads
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-${{ hashFiles('composer.json', 'composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ github.job }}-${{ strategy.job-index }}-
composer-${{ runner.os }}-${{ github.job }}-

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

- name: Execute tests
if: env.COVERAGE != 'true'
run: vendor/bin/phpunit

- name: Execute tests with coverage
if: env.COVERAGE == 'true'
run: vendor/bin/phpunit --coverage-clover build/coverage.xml

- name: Upload coverage to Codecov
if: env.COVERAGE == 'true'
uses: codecov/codecov-action@v5
with:
files: build/coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ composer.lock
vendor
coverage
.phpunit.result.cache
.php-cs-fixer.cache
.idea
clover.xml
node_modules
.phpunit.cache
35 changes: 0 additions & 35 deletions .php_cs.dist.php

This file was deleted.

19 changes: 0 additions & 19 deletions .scrutinizer.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .styleci.yml

This file was deleted.

Loading
Loading