322 lines (320 loc) · 10.3 KB
/
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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: CI
on:
push:
branches:
- v6
pull_request:
env:
SEQ_DB: sequelize_test
SEQ_USER: sequelize_test
SEQ_PW: sequelize_test
jobs:
lint:
name: Lint code and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn lint-docs
docs:
name: Generate docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn install --frozen-lockfile
- run: yarn docs
test-typings:
strategy:
fail-fast: false
matrix:
ts-version: ["4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8"]
name: TS Typings (${{ matrix.ts-version }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn install --frozen-lockfile
- run: yarn add --dev typescript@~${{ matrix.ts-version }}
- run: yarn test-typings
test-oracle:
strategy:
fail-fast: false
matrix:
oracle-version: [18, 21]
node-version: [10, 18]
name: Oracle DB ${{ matrix.oracle-version }} (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
env:
DIALECT: oracle
SEQ_ORACLE_USER: sequelizetest
SEQ_ORACLE_PW: sequelizepassword
SEQ_ORACLE_DB: XEPDB1
SEQ_ORACLE_HOST: localhost
SEQ_ORACLE_PORT: 1521
LD_LIBRARY_PATH: ${{ github.workspace }}/.oracle/instantclient
UV_THREADPOOL_SIZE: 128
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- if: matrix.oracle-version == '18'
name: Install Local Oracle DB 18
run: yarn start-oracle-oldest
- if: matrix.oracle-version == '21'
name: Install Local Oracle DB 21
run: yarn start-oracle-latest
- name: Unit Tests
run: yarn test-unit
- name: Integration Tests
run: yarn test-integration
test-db2:
strategy:
fail-fast: false
matrix:
node-version: [10, 16]
name: DB2 (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
env:
DIALECT: db2
SEQ_DB: testdb
SEQ_USER: db2inst1
SEQ_PW: password
SEQ_TEST_CLEANUP_TIMEOUT: 1200000
SEQ_PORT: 50000
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- name: Install Local DB2 Copy
run: yarn start-db2
- name: Unit Tests
run: yarn test-unit
continue-on-error: true
- name: Integration Tests
run: yarn test-integration
continue-on-error: true
test-sqlite:
strategy:
fail-fast: false
matrix:
node-version: [10, 16]
name: SQLite (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
env:
DIALECT: sqlite
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- name: Unit Tests
run: yarn test-unit
- name: Integration Tests
run: yarn test-integration
test-postgres:
strategy:
fail-fast: false
matrix:
node-version: [10, 16]
postgres-version: [9.5, 10] # Does not work with 12
minify-aliases: [true, false]
native: [true, false]
name: Postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (Node ${{ matrix.node-version }})${{ matrix.minify-aliases && ' (minified aliases)' || '' }}
runs-on: ubuntu-latest
services:
postgres:
image: sushantdhiman/postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: sequelize_test
POSTGRES_DB: sequelize_test
POSTGRES_PASSWORD: sequelize_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
SEQ_PORT: 5432
DIALECT: ${{ matrix.native && 'postgres-native' || 'postgres' }}
SEQ_PG_MINIFY_ALIASES: ${{ matrix.minify-aliases && '1' || '' }}
steps:
- run: PGPASSWORD=sequelize_test psql -h localhost -p 5432 -U sequelize_test sequelize_test -c '\l'
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- run: yarn add pg-native --ignore-engines
if: matrix.native
- name: Unit Tests
run: yarn test-unit
if: ${{ !matrix.minify-aliases }}
- name: Integration Tests
run: yarn test-integration
test-mysql-mariadb:
strategy:
fail-fast: false
matrix:
include:
- name: MySQL 5.7
image: mysql:5.7
dialect: mysql
node-version: 10
- name: MySQL 5.7
image: mysql:5.7
dialect: mysql
node-version: 16
- name: MySQL 8.0
image: mysql:8.0
dialect: mysql
node-version: 10
- name: MySQL 8.0
image: mysql:8.0
dialect: mysql
node-version: 16
- name: MariaDB 10.3
image: mariadb:10.3
dialect: mariadb
node-version: 10
- name: MariaDB 10.3
image: mariadb:10.3
dialect: mariadb
node-version: 16
- name: MariaDB 10.5
image: mariadb:10.5
dialect: mariadb
node-version: 10
- name: MariaDB 10.5
image: mariadb:10.5
dialect: mariadb
node-version: 16
name: ${{ matrix.name }} (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
services:
mysql:
image: ${{ matrix.image }}
env:
MYSQL_DATABASE: sequelize_test
MYSQL_USER: sequelize_test
MYSQL_PASSWORD: sequelize_test
MYSQL_ROOT_PASSWORD: sequelize_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin -usequelize_test -psequelize_test status" --health-interval 10s --health-timeout 5s --health-retries 5 --tmpfs /var/lib/mysql:rw
env:
SEQ_PORT: 3306
DIALECT: ${{ matrix.dialect }}
steps:
- run: mysql --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;"
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- name: Unit Tests
run: yarn test-unit
- name: Integration Tests
run: yarn test-integration
test-mssql:
strategy:
fail-fast: false
matrix:
node-version: [10, 16]
mssql-version: [2017, 2019]
name: MSSQL ${{ matrix.mssql-version }} (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:${{ matrix.mssql-version }}-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password12!
ports:
- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P \"Password12!\" -l 30 -Q \"SELECT 1\""
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
DIALECT: mssql
SEQ_USER: SA
SEQ_PW: Password12!
SEQ_PORT: 1433
steps:
- run: /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE sequelize_test; ALTER DATABASE sequelize_test SET READ_COMMITTED_SNAPSHOT ON;"
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- name: Unit Tests
run: yarn test-unit
- name: Integration Tests
run: yarn test-integration
test-snowflake:
strategy:
fail-fast: false
matrix:
node-version: [10, 16]
name: SNOWFLAKE (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
env:
DIALECT: snowflake
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile --ignore-engines
- name: Unit Tests
run: yarn test-unit
# - name: Integration Tests
# run: yarn test-integration
release:
name: Release
runs-on: ubuntu-latest
needs:
[
lint,
docs,
test-typings,
test-sqlite,
test-postgres,
test-mysql-mariadb,
test-mssql,
]
if: github.event_name == 'push' && (github.ref == 'refs/heads/v6' || github.ref == 'refs/heads/v6-beta')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn install --frozen-lockfile
- run: npx semantic-release
- id: sequelize
uses: sdepold/github-action-get-latest-release@master
with:
repository: sequelize/sequelize
- name: Notify channels
run: |
curl -XPOST -u "sdepold:${{ secrets.GH_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/sequelize/sequelize/dispatches --data '{"event_type":"Release notifier","client_payload":{"release-id": ${{ steps.sequelize.outputs.id }}}}'
- name: Notify docs repo
run: |
curl -XPOST -u "sdepold:${{ secrets.GH_TOKEN }}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/sequelize/website/dispatches --data '{"event_type":"Build website"}'