This repository was archived by the owner on May 14, 2020. It is now read-only.
forked from B-Galati/gh-archive-keyword
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (85 loc) · 3.27 KB
/
migrations.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
87
88
name: Test migrations
on: [push]
jobs:
test-migrations:
name: Test migrations
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: api_db
MYSQL_ROOT_PASSWORD: testbench
MYSQL_USER: sys
MYSQL_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "3308:3306"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use php 7.3
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: fileinfo, dom, tokenizer, simplexml, curl
coverage: none
- name: Cache module
uses: actions/[email protected]
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: |
php -v && composer --version
composer install --no-suggest --no-interaction --optimize-autoloader
- name: Run all migrations
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
DB_DATABASE: api_db
DB_USERNAME: sys
DB_PASSWORD: password
run: php artisan migrate --step --database=mysql --verbose --force
test-migrations-and-rollback:
name: Test migrations and rollback
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: api_db
MYSQL_ROOT_PASSWORD: testbench
MYSQL_USER: sys
MYSQL_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "3308:3306"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use php 7.3
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: fileinfo, dom, tokenizer, simplexml, curl
coverage: none
- name: Cache module
uses: actions/[email protected]
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: |
php -v && composer --version
composer install --no-suggest --no-interaction --optimize-autoloader
- name: Run all migrations and rollback
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
DB_DATABASE: api_db
DB_USERNAME: sys
DB_PASSWORD: password
run: |
php artisan migrate --step --database=mysql --verbose --force
php artisan migrate:reset --database=mysql --verbose --force