With filament resources #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Laravel Filament Tests | |
on: | |
push: | |
branches: [ main, docker ] | |
pull_request: | |
branches: [ main, docker ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.2, 8.3] | |
name: P${{ matrix.php }} - Laravel 10.x | |
services: | |
mysql: | |
image: mysql:8.3 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: laravel_test | |
ports: | |
- 3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: none | |
- uses: actions/checkout@v4 | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Run Migrations | |
env: | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
DB_DATABASE: laravel_test | |
DB_USERNAME: root | |
DB_PASSWORD: password | |
run: php artisan migrate --force | |
- name: Execute tests (PEST) | |
env: | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: ${{ job.services.mysql.ports[3306] }} | |
DB_DATABASE: laravel_test | |
DB_USERNAME: root | |
DB_PASSWORD: password | |
run: vendor/bin/pest | |
- name: Run Larastan | |
run: ./vendor/bin/phpstan analyse | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: logs | |
path: storage/logs |