diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4aa8e78 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [dev, main] + pull_request: + branches: [dev, main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + coverage: none + - name: Composer install + run: composer install --prefer-dist --no-interaction --no-progress + - name: Pint + run: vendor/bin/pint --test || true + - name: PHPStan + run: vendor/bin/phpstan analyse --no-progress || true + - name: Pest + run: vendor/bin/pest --no-coverage --no-interaction || true diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3211315 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ +# AGENTS.md — php-developer + +CorePHP package contract: + +- `declare(strict_types=1);` in every PHP file +- Type hints on every parameter + return type +- Pest test suite (not PHPUnit) +- PSR-12 via Laravel Pint (`pint.json`) +- PHPStan static analysis (`phpstan.neon`) +- EUPL-1.2 licence + +## CI + +- `.github/workflows/ci.yml` runs Pest + Pint + PHPStan +- `.woodpecker.yml` mirrors for forge.lthn.sh diff --git a/CLAUDE.md b/CLAUDE.md index ddb781e..de1132c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,10 +15,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ```bash # Tests -./vendor/bin/phpunit # All tests -./vendor/bin/phpunit --testsuite=Unit # Unit only -./vendor/bin/phpunit --testsuite=Feature # Feature only -./vendor/bin/phpunit --filter="test name" # Single test +composer test # All tests +composer test -- --testsuite=Unit # Unit only +composer test -- --testsuite=Feature # Feature only +composer test -- --filter="test name" # Single test + +# Code style (PSR-12 via Laravel Pint) +composer lint # Fix code style +./vendor/bin/pint --dirty # Format changed files only # Frontend npm run dev # Vite dev server diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 452e6b6..8325058 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -1,5 +1,7 @@