Skip to content

Instantly share code, notes, and snippets.

@zaratedev
Created Aug 31, 2020
Embed
What would you like to do?
Github actions for Laravel dusk
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
BCRYPT_ROUNDS=4
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dusk
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=us2
ANALYTICS_DRIVER=array
CACHE_DRIVER=array
FILESYSTEM_CLOUD=local
LOG_CHANNEL=single
MAIL_DRIVER=array
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
name: Continuos Integration for Laravel Dusk
on: [push]
jobs:
dusk-php:
runs-on: ubuntu-latest
services:
mysql:
image: mariadb:10.2
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: dusk
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Prepare The Environment
run: cp .env.ci .env
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install Composer Dependencies
run: |
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
chmod -R 777 storage bootstrap/cache
npm install
npm run production
- name: Generate Application Key
run: |
php artisan key:generate
php artisan passport:keys
- name: Upgrade Chrome Driver
run: php artisan dusk:chrome-driver
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 &
- name: Run Laravel Server
run: php artisan serve > /dev/null 2>&1 &
- name: Run Dusk Tests
run: |
chmod -R 0755 vendor/laravel/dusk/bin/
php artisan dusk
env:
APP_ENV: local
APP_URL: "http://127.0.0.1:8000"
DB_CONNECTION: mysql
DB_DATABASE: dusk
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment