-
Notifications
You must be signed in to change notification settings - Fork 46
104 lines (81 loc) · 2.75 KB
/
ci.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
branches: [master, develop]
jobs:
deploy:
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:8.0.21
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: zip, curl, mbstring, dom, soap, xdebug, mysql, gd
- name: Install dependencies
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
- name: Create Database
run: mysql --host 127.0.0.1 --port 3306 -uroot -e "CREATE DATABASE mercator CHARACTER SET utf8 COLLATE utf8_general_ci;"
- name: Configrue Storage Permission
run: chmod -R 777 storage bootstrap/cache
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.ci', '.env');"
- name: Set the application key
run: |
php artisan key:generate
- name: Publish any publishable assets from vendor packages
run: |
php artisan vendor:publish --all
- name: Remove the configuration cache file
run: |
php artisan config:clear
- name: Migrate and seed the database
run: |
php artisan migrate --seed
- name: Insert test data
run: |
mysql mercator --host 127.0.0.1 --port 3306 -uroot < mercator_data.sql
- name: Install Chrome Driver
run: php artisan dusk:chrome-driver --detect
- name: Check Chrome Driver version
run: ./vendor/laravel/dusk/bin/chromedriver-linux -v
- name: Start Chrome Driver
run: ./vendor/laravel/dusk/bin/chromedriver-linux --port=9515 &
- name: Run Laravel Server
run: php artisan serve --no-reload &
- name: Run Dusk Tests
env:
APP_ENV: local
APP_URL: "http://127.0.0.1:8000"
DB_CONNECTION: mysql
DB_DATABASE: mercator
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root
run: |
php artisan dusk --stop-on-error --stop-on-failure
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: tests/Browser/screenshots
- name: Upload Console Logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: console
path: tests/Browser/console