Skip to content

Use switch instead of match #94

Use switch instead of match

Use switch instead of match #94

Workflow file for this run

name: Laravel Dusk
on:
push:
branches: [ develop, stable ]
paths:
- '**.php'
- '**.json'
- '**.lock'
workflow_dispatch:
jobs:
dusk:
name: Test with Laravel Dusk
runs-on: ubuntu-latest
env:
APP_NAME: LANager
APP_KEY: ${{ secrets.APP_KEY }}
APP_URL: http://localhost:8000
APP_ENV: testing
APP_TIMEZONE: UTC
APP_LOCALE: en
APP_DEBUG: true
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
DB_CONNECTION: mysql
DB_HOST: localhost
DB_PORT: 3306
DB_DATABASE: lanager
DB_USERNAME: root
DB_PASSWORD: root
CACHE_STORE: file
SESSION_DRIVER: database
SESSION_LIFETIME: 7200
LOG_CHANNEL: file
DUSK_DRIVER_URL: http://localhost:9515
COLUMNS: 240
steps:
- name: Start MySQL
run: sudo /etc/init.d/mysql start
- name: Create database
run: mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }}
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: xmlwriter, zip, pdo, pdo_mysql, tokenizer, simplexml, bcmath, fileinfo
ini-values: error_reporting=22527
- name: Install Composer dependencies
run: composer install --optimize-autoloader --no-interaction --no-progress --no-scripts
- name: Setup Node
uses: actions/setup-node@v3
- name: Install Node dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Link Laravel storage directory
run: php artisan storage:link
- name: Run database migrations
run: php artisan migrate
- name: Seed database
run: php artisan db:seed --class="Database\\Seeders\\DatabaseSeeder"
- name: Upgrade Chrome Driver
run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
- name: Create empty .env file
run: touch .env
- name: Start built-in webserver
run: php artisan serve > /dev/null 2>&1 &
- name: Run Laravel Dusk tests
run: php artisan dusk
- name: Upload Browser Screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: browser-screenshots
path: storage/logs/dusk/screenshots
- name: Upload Browser Console Logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: console-logs
path: storage/logs/dusk/console
- name: Upload Page Source
uses: actions/upload-artifact@v4
if: failure()
with:
name: page-source
path: storage/logs/dusk/source
- name: Upload Laravel Log
uses: actions/upload-artifact@v4
with:
name: laravel-log
path: storage/logs/laravel.log
if-no-files-found: ignore