Skip to content

Cron-test

Cron-test #785

Workflow file for this run

name: Cron-test
on:
schedule:
- cron: '0 1,13 * * *'
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 15.x, 16.x ]
php-version: [ 8.x ]
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: laravel
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
options: --name redis
steps:
- uses: actions/checkout@v2
- name: Setup Timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: redis
tools: composer:v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.ci', '.env');"
- name: Composer Install
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Npm Install And Build
run: |
npm install --quiet
npm run dev
- name: Generate Key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Database Migrate
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: Start Chrome Drive
run: ./vendor/laravel/dusk/bin/chromedriver-linux &
- name: Start Web Server
run: php artisan serve --host 127.0.0.1 --port 8000 --no-reload &
- name: PHPunit Test
run: php artisan test
- name: Dusk Test
run: php artisan dusk
env:
APP_URL: "http://127.0.0.1:8000"
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v2
with:
name: screenshots
path: tests/Browser/screenshots
- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: console
path: tests/Browser/console