-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (131 loc) · 3.94 KB
/
example.yaml
File metadata and controls
149 lines (131 loc) · 3.94 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: SQLDef Preview
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
psqldef-preview:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Preview PostgreSQL schema changes
uses: ./
with:
command: psqldef
version: latest
config-file: examples/psqldef.yaml
baseline-schema-file: examples/psqldef-current.sql
schema-file: examples/psqldef-desired.sql
pg-user: postgres
pg-password: postgres
pg-host: localhost
pg-port: 5432
pg-database: testdb
github-token: ${{ github.token }}
mysqldef-preview:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: testpass
MYSQL_DATABASE: testdb
options: >-
--health-cmd "mysqladmin ping -h localhost -u root -ptestpass"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 3306:3306
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Preview MySQL schema changes
uses: ./
with:
command: mysqldef
version: latest
config-file: examples/mysqldef.yaml
baseline-schema-file: examples/mysqldef-current.sql
schema-file: examples/mysqldef-desired.sql
mysql-user: root
mysql-password: testpass
mysql-host: 127.0.0.1
mysql-port: 3306
mysql-database: testdb
github-token: ${{ github.token }}
sqlite3def-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Preview SQLite schema changes
uses: ./
with:
command: sqlite3def
version: latest
config-file: examples/sqlite3def.yaml
baseline-schema-file: examples/sqlite3def-current.sql
schema-file: examples/sqlite3def-desired.sql
sqlite-database: test.db
github-token: ${{ github.token }}
mssqldef-preview:
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Passw0rd
options: >-
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P Passw0rd -Q 'SELECT 1' -C || /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P Passw0rd -Q 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 10
--health-start-period 20s
ports:
- 1433:1433
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Create MSSQL database
run: |
docker exec $(docker ps -q -f "ancestor=mcr.microsoft.com/mssql/server:2022-latest") \
/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P "Passw0rd" -Q "CREATE DATABASE testdb;" -C
- name: Preview MSSQL schema changes
uses: ./
with:
command: mssqldef
version: latest
config-file: examples/mssql.yaml
baseline-schema-file: examples/mssqldef-current.sql
schema-file: examples/mssqldef-desired.sql
mssql-user: SA
mssql-password: Passw0rd
mssql-host: localhost
mssql-port: 1433
mssql-database: testdb
github-token: ${{ github.token }}