-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-mysql-ci.yml
59 lines (46 loc) · 1.68 KB
/
git-mysql-ci.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
name: Unit Test
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
PHPUnit:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.21
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: unittest
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Verify unittest DB exists
run: mysql --host 127.0.0.1 --port 3306 -uroot -e "SHOW DATABASES LIKE 'unittest'"
- name: Create 2nd Database
run: mysql --host 127.0.0.1 --port 3306 -uroot -e "CREATE DATABASE IF NOT EXISTS unittest_second;"
- name: Verify unittest_second DB exists
run: mysql --host 127.0.0.1 --port 3306 -uroot -e "SHOW DATABASES LIKE 'unittest_second'"
- name: Copy the .env
run: cp .env.example .env
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Configrue Storage Permission
run: chmod -R 777 storage bootstrap/cache
- name: Generate Application Key
run: php artisan key:generate
- name: Clear Configuration
run: php artisan config:clear
- name: Configure Application
run:
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: mysql
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: ""
DB_DATABASE: unittest
run: vendor/bin/phpunit