Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
name: Dusk Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
dusk-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: thisisasecretpassword
POSTGRES_DB: laravel
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DB_USERNAME: myuser
DB_PASSWORD: thisisasecretpassword
APP_URL: http://127.0.0.1:8000
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: php -r "copy('.env.example', '.env');"
- name: Remove .env.dusk.local
run: rm .env.dusk.local
- 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
run: php artisan migrate
- name: Upgrade Chrome Driver
run: php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
- name: Change permissions to dusk
run: chmod -R 0755 vendor/laravel/dusk/bin/
- name: Run Laravel Server
run: php artisan serve > /dev/null 2>&1 &
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 &
- name: Execute dusk tests
run: php artisan dusk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment