Skip to content

Migrate to spatie/laravel-html #1550

Migrate to spatie/laravel-html

Migrate to spatie/laravel-html #1550

Workflow file for this run

name: Laravel tests
on:
push:
branches:
- master
pull_request: {}
jobs:
laravel-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
php-versions:
- 8.2
services:
mysql:
image: mariadb:10.5
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: laravel
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
extensions: zip, mbstring, dom, fileinfo, mysql
php-version: ${{ matrix.php-versions }}
- uses: actions/checkout@v1
- name: Copy env file
run: cp .env.ci .env
- name: Cache Composer dependencies
uses: actions/cache@v2
env:
cache-name: cache-composer-dependencies
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cache NPM dependencies
uses: actions/cache@v2
env:
cache-name: cache-node-dependencies
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
- name: Install NPM dependencies
run: npm install
- name: Set app key
run: php artisan key:generate
- name: Clear config cache
run: php${{ matrix.php }} artisan config:clear
- name: Run migrations
run: php${{ matrix.php }} artisan migrate -v --force
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Build assets
run: npm run production
- name: Run tests
run: composer test
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Start chromedriver
run: chromedriver &
- name: Start Laravel Server
run: php artisan serve &
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Run Browser Tests
run: php artisan dusk
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- uses: actions/upload-artifact@v2
name: Save Dusk screenshots
if: failure()
with:
name: dusk-screenshots
path: tests/Browser/screenshots/*.png