2045c856e9
- Add 10 core testing guides (setup, AAA principles, PHPUnit/Pest, mocking, anti-patterns, PHP 8.4+, debugging, data factories, advanced edge cases) - Add 13 component testing guides covering all Laravel layers - Add standard templates for PHPUnit 10/11 and Pest v2/v3 including ArchitectureTest - Add Docker smart test runner, dependency installer, and CI/CD templates (GitHub Actions, GitLab CI) - Add 4 Claude Code skills (laravel-test-setup, laravel-unit-test with --all mode, laravel-test-review, laravel-mock-helper) - Add single unified installer script (sg-install-unit-testing.sh) with global support, CLI runners, and 1-click updater (sg-test-update) - Add comprehensive documentation (README.md, USAGE-GUIDE.md) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35 lines
890 B
Plaintext
35 lines
890 B
Plaintext
# GitLab CI/CD Pipeline for Laravel Unit Testing
|
|
image: php:8.3-cli-alpine
|
|
|
|
stages:
|
|
- test
|
|
|
|
variables:
|
|
APP_ENV: "testing"
|
|
DB_CONNECTION: "sqlite"
|
|
DB_DATABASE: ":memory:"
|
|
CACHE_STORE: "array"
|
|
QUEUE_CONNECTION: "sync"
|
|
MAIL_MAILER: "array"
|
|
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- vendor/
|
|
|
|
unit-test:
|
|
stage: test
|
|
before_script:
|
|
- apk add --no-cache sqlite-libs libzip-dev zip unzip git $PHPIZE_DEPS
|
|
- pecl install pcov && docker-php-ext-enable pcov
|
|
- docker-php-ext-install pdo pdo_sqlite zip
|
|
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
- composer install --prefer-dist --no-progress --no-interaction
|
|
script:
|
|
- php artisan test --testsuite=Unit --coverage --min=80
|
|
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
|
|
artifacts:
|
|
when: always
|
|
reports:
|
|
junit: phpunit-report.xml
|