-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (80 loc) · 2.45 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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