-
Notifications
You must be signed in to change notification settings - Fork 3
287 lines (277 loc) · 8.89 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
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
name: CI
on:
# We would like to trigger for CI for any pull request action -
# both from QuantCo's branches as well as forks.
pull_request:
types: [opened, labeled, unlabeled, synchronize]
# In addition to pull requests, we want to run CI for pushes
# to the main branches and tags.
push:
branches:
- "main"
- "pre-commit-autoupdate"
tags:
- "v*"
jobs:
pre-commit-checks:
name: Pre-commit Checks
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
unit-tests:
name: "unit tests"
strategy:
fail-fast: true
matrix:
env:
- py38
- py39
- py310
- py311
- py312
- sa1
- sa2
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage --color=yes
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
mssql:
if: ${{ contains(github.event.pull_request.labels.*.name, 'sqlserver') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
name: "mssql"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- mssql-py38
- mssql-py39
- mssql-py310
- mssql-py311
- mssql-py312
- mssql-sa1
- mssql-sa2
services:
DB:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: datajudge-123
ports:
- 1433:1433
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
# TODO: Consider removing this manual installation since the docker image already comes with a msodbc driver.
- name: Install msodbcsql17 driver
run: |
wget https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.9.1.1-1_amd64.deb
ACCEPT_EULA=Y sudo apt install ./msodbcsql17_17.9.1.1-1_amd64.deb --allow-downgrades
- name: Wait for SQL Server
timeout-minutes: 1
run: until docker logs "${{ job.services.db.id }}" 2>&1 | grep -q "SQL Server is now ready"; do sleep 10; done
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage --color=yes
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
postgres:
if: ${{ contains(github.event.pull_request.labels.*.name, 'postgres') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
name: PostgreSQL
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
postgres_version:
- latest
- 11
env:
- postgres-py38
- postgres-py39
- postgres-py310
- postgres-py311
- postgres-py312
- postgres-sa1
- postgres-sa2
services:
DB:
image: postgres:${{ matrix.postgres_version }}
env:
POSTGRES_USER: datajudge
POSTGRES_PASSWORD: datajudge
POSTGRES_DB: datajudge
ports:
- 5432:5432
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage --color=yes
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
db2:
if: ${{ contains(github.event.pull_request.labels.*.name, 'db2') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
name: DB2
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- db2-py38
- db2-py39
- db2-py310
- db2-sa1
services:
DB:
image: ibmcom/db2:11.5.5.1
env:
LICENSE: accept
DB2INSTANCE: db2inst1
DB2INST1_PASSWORD: password
DBNAME: testdb
UPDATEAVAIL: "NO"
options: --privileged
ports:
- 50000:50000
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- name: Wait for db2 to load
timeout-minutes: 2
run: until docker logs "${{ job.services.db.id }}" 2>&1 | grep -q 'Setup has completed.'; do sleep 5; done
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage --color=yes
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
snowflake:
if: ${{ contains(github.event.pull_request.labels.*.name, 'snowflake') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
name: "Snowflake"
runs-on: ubuntu-latest
env:
SNOWFLAKE_USER: DATAJUDGE
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
strategy:
fail-fast: false
matrix:
env:
- snowflake-py38
- snowflake-sa1
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage --color=yes
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
# The authentication of these tests is currently failing.
# These tests should be reenabled asap.
# bigquery:
# if: ${{ contains(github.event.pull_request.labels.*.name, 'bigquery') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
# name: "BigQuery"
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# env:
# - bigquery-py38
# - bigquery-sa1
# steps:
# - name: 'Authenticate to Google Cloud'
# uses: 'google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa'
# with:
# credentials_json: '${{ secrets.GCP_KEY }}'
# - name: Checkout branch
# uses: actions/checkout@v4
# - name: Set up pixi
# uses: prefix-dev/[email protected]
# with:
# environments: ${{ matrix.env }}
# - run: |
# pixi run -e ${{ matrix.env }} postinstall
# pixi run -e ${{ matrix.env }} coverage
# - name: Generate code coverage report
# uses: codecov/[email protected]
# with:
# file: ./coverage.xml
# token: ${{ secrets.CODECOV_TOKEN }}
impala:
if: ${{ contains(github.event.pull_request.labels.*.name, 'impala') || contains(github.event.pull_request.labels.*.name, 'ready') || github.ref == 'refs/heads/main' }}
name: "Impala"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- impala-py38
- impala-sa1
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up container
run: docker compose up --wait impala
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} coverage
- name: Generate code coverage report
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}