5
5
branches : [main]
6
6
7
7
jobs :
8
+ static_checks :
9
+ name : Static Checks
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - uses : actions/checkout@master
14
+ with :
15
+ ref : ${{ github.ref }}
16
+
17
+ - uses : c-hive/gha-yarn-cache@v2
18
+ - name : Setup Golang caches
19
+ uses : actions/cache@v3
20
+ with :
21
+ path : |
22
+ ~/.cache/go-build
23
+ ~/go/pkg/mod
24
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
25
+ restore-keys : |
26
+ ${{ runner.os }}-golang-
27
+
28
+ - run : ./scripts/ci/prepare_linux.sh --integration-tests
29
+
30
+ - run : yarn format
31
+ - run : yarn eslint ui
32
+ - run : yarn tsc
33
+ - run : cd runner && gofmt -w .
34
+
35
+ - run : yarn build-language-definitions
36
+
37
+ - run : ./scripts/fail_on_diff.sh
38
+
39
+ - run : yarn test-licenses
40
+
8
41
linux_node_ui_tests :
9
42
name : Linux Node/UI Tests
10
43
runs-on : ubuntu-latest
@@ -34,4 +67,304 @@ jobs:
34
67
uses : actions/upload-artifact@v3
35
68
with :
36
69
name : non-credential-coverage
37
- path : coverage/*.cov
70
+ path : coverage/*.cov
71
+
72
+ macos_node_ui_tests :
73
+ name : macOS Node/UI Tests
74
+ runs-on : macos-latest
75
+
76
+ steps :
77
+ - uses : actions/checkout@master
78
+ with :
79
+ ref : ${{ github.ref }}
80
+
81
+ - uses : c-hive/gha-yarn-cache@v2
82
+ - name : Setup Golang caches
83
+ uses : actions/cache@v3
84
+ with :
85
+ path : |
86
+ ~/.cache/go-build
87
+ ~/go/pkg/mod
88
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
89
+ restore-keys : |
90
+ ${{ runner.os }}-golang-
91
+
92
+ - run : ./scripts/ci/prepare_macos.sh
93
+ # Needed so we can have ./build/desktop_runner.js and ./build/go_desktop_runner ready for tests
94
+ - run : yarn build-test-runner
95
+ - run : yarn test ui desktop shared --detectOpenHandles --forceExit --verbose
96
+
97
+ windows_ui_tests :
98
+ name : Windows UI Tests
99
+ runs-on : windows-latest
100
+
101
+ steps :
102
+ - uses : actions/checkout@master
103
+ with :
104
+ ref : ${{ github.ref }}
105
+
106
+ - uses : c-hive/gha-yarn-cache@v2
107
+ - name : Setup Golang caches
108
+ uses : actions/cache@v3
109
+ with :
110
+ path : |
111
+ ~/.cache/go-build
112
+ ~/go/pkg/mod
113
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
114
+ restore-keys : |
115
+ ${{ runner.os }}-golang-
116
+
117
+ - run : ./scripts/ci/prepare_windows.ps1
118
+ shell : pwsh
119
+
120
+ # Needed so we can have ./build/desktop_runner.js and ./build/go_desktop_runner ready for tests
121
+ - run : yarn build-test-runner
122
+ - run : yarn test ui --detectOpenHandles --forceExit --verbose
123
+
124
+ credentialed_integration_tests :
125
+ name : Credentialed Database Integration Tests that Require Special Permissions to Succeed
126
+ runs-on : ubuntu-latest
127
+
128
+ steps :
129
+ - uses : actions/checkout@master
130
+ with :
131
+ ref : ${{ github.ref }}
132
+
133
+ - uses : c-hive/gha-yarn-cache@v2
134
+ - name : Setup Golang caches
135
+ uses : actions/cache@v3
136
+ with :
137
+ path : |
138
+ ~/.cache/go-build
139
+ ~/go/pkg/mod
140
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
141
+ restore-keys : |
142
+ ${{ runner.os }}-golang-
143
+
144
+ - run : ./scripts/ci/prepare_linux.sh --integration-tests
145
+ # Needed so we can have ./build/desktop_runner.js and ./build/go_desktop_runner ready for tests
146
+ - run : yarn build-test-runner
147
+ - run : RUN_CREDENTIAL_TESTS=true yarn test --detectOpenHandles --forceExit --verbose integration/credential_database.test.js
148
+ env :
149
+ AIRTABLE_TOKEN : ${{ secrets.AIRTABLE_TOKEN }}
150
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
151
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
152
+ BIGQUERY_TOKEN : ${{ secrets.BIGQUERY_TOKEN }}
153
+ SNOWFLAKE_USER : ${{ secrets.SNOWFLAKE_USER }}
154
+ SNOWFLAKE_PASSWORD : ${{ secrets.SNOWFLAKE_PASSWORD }}
155
+ SNOWFLAKE_ACCOUNT : ${{ secrets.SNOWFLAKE_ACCOUNT }}
156
+
157
+ - name : Upload credential coverage
158
+ uses : actions/upload-artifact@v3
159
+ with :
160
+ name : credential-coverage
161
+ path : coverage/*.cov
162
+
163
+ linux_go_tests :
164
+ name : Linux Go Tests
165
+ runs-on : ubuntu-latest
166
+ needs :
167
+ - credentialed_integration_tests
168
+ - linux_node_ui_tests
169
+
170
+ steps :
171
+ - uses : actions/checkout@master
172
+ with :
173
+ ref : ${{ github.ref }}
174
+
175
+ - name : Setup Golang caches
176
+ uses : actions/cache@v3
177
+ with :
178
+ path : |
179
+ ~/.cache/go-build
180
+ ~/go/pkg/mod
181
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
182
+ restore-keys : |
183
+ ${{ runner.os }}-golang-
184
+
185
+ - run : ./scripts/ci/prepare_linux.sh --integration-tests
186
+
187
+ # Run golangci-lint
188
+ - name : Run golangci-lint
189
+ uses : golangci/golangci-lint-action@v3
190
+ with :
191
+ working-directory : runner
192
+ args : --timeout 3m --verbose
193
+
194
+ # Grab coverage files from other tests
195
+ - run : mkdir coverage
196
+ - name : Download credential coverage
197
+ uses : actions/download-artifact@v3
198
+ with :
199
+ name : credential-coverage
200
+ - name : Download non-credential coverage
201
+ uses : actions/download-artifact@v3
202
+ with :
203
+ name : non-credential-coverage
204
+ # Artifacts get downloaded into this directory
205
+ - run : mv gorunner*.cov coverage/
206
+
207
+ # Run tests and coverage
208
+ - run : cd runner && go test -race -coverprofile ../coverage/gounit.cov
209
+ - run : ls coverage
210
+ - run : ./runner/scripts/test_coverage.sh
211
+
212
+ macos_go_tests :
213
+ name : macOS Go Tests
214
+ runs-on : macos-latest
215
+
216
+ steps :
217
+ - uses : actions/checkout@master
218
+ with :
219
+ ref : ${{ github.ref }}
220
+
221
+ - name : Setup Golang caches
222
+ uses : actions/cache@v3
223
+ with :
224
+ path : |
225
+ ~/.cache/go-build
226
+ ~/go/pkg/mod
227
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
228
+ restore-keys : |
229
+ ${{ runner.os }}-golang-
230
+
231
+ - run : ./scripts/ci/prepare_macos.sh
232
+
233
+ - run : cd runner && go test
234
+
235
+ windows_go_tests :
236
+ name : windows Go Tests
237
+ runs-on : windows-latest
238
+
239
+ steps :
240
+ - uses : actions/checkout@master
241
+ with :
242
+ ref : ${{ github.ref }}
243
+
244
+ - name : Setup Golang caches
245
+ uses : actions/cache@v3
246
+ with :
247
+ path : |
248
+ ~/.cache/go-build
249
+ ~/go/pkg/mod
250
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
251
+ restore-keys : |
252
+ ${{ runner.os }}-golang-
253
+
254
+ - run : ./scripts/ci/prepare_windows.ps1
255
+ shell : pwsh
256
+
257
+ - run : cd runner && go test
258
+
259
+ e2e_linux_tests :
260
+ name : End-to-end Linux Tests
261
+ runs-on : ubuntu-latest
262
+
263
+ steps :
264
+ - uses : actions/checkout@master
265
+ with :
266
+ ref : ${{ github.ref }}
267
+
268
+ - uses : c-hive/gha-yarn-cache@v2
269
+ - name : Setup Golang caches
270
+ uses : actions/cache@v3
271
+ with :
272
+ path : |
273
+ ~/.cache/go-build
274
+ ~/go/pkg/mod
275
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
276
+ restore-keys : |
277
+ ${{ runner.os }}-golang-
278
+
279
+ - run : ./scripts/ci/prepare_linux.sh
280
+ - run : yarn release-desktop 0.0.0-e2etest
281
+ - run : git reset --hard # release blows everything up
282
+ # Set up a virtual framebuffer so Chrome will start
283
+ # https://www.electronjs.org/docs/tutorial/testing-on-headless-ci
284
+ # https://github.com/juliangruber/browser-run/issues/147
285
+ - run : xvfb-run --auto-servernum yarn e2e-test
286
+
287
+ e2e_macos_tests :
288
+ name : End-to-end macOS Tests
289
+ runs-on : macos-latest
290
+
291
+ steps :
292
+ - uses : actions/checkout@master
293
+ with :
294
+ ref : ${{ github.ref }}
295
+
296
+ - uses : c-hive/gha-yarn-cache@v2
297
+ - name : Setup Golang caches
298
+ uses : actions/cache@v3
299
+ with :
300
+ path : |
301
+ ~/.cache/go-build
302
+ ~/go/pkg/mod
303
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
304
+ restore-keys : |
305
+ ${{ runner.os }}-golang-
306
+
307
+ - run : ./scripts/ci/prepare_macos.sh
308
+ # Needed so we can have ./build/desktop_runner.js ready for tests
309
+ - run : yarn build-test-runner
310
+ # https://github.com/golang/go/issues/49138 bug in macos -race detector
311
+ - run : MallocNanoZone=0 yarn test --detectOpenHandles --forceExit --verbose shared ui desktop
312
+ - run : cd runner && MallocNanoZone=0 go test -race -cover
313
+ - run : yarn release-desktop 0.0.0-e2etest
314
+ - run : git reset --hard # release blows everything up
315
+ - run : yarn e2e-test
316
+
317
+ e2e_windows_tests :
318
+ name : End-to-end Windows Tests
319
+ runs-on : windows-latest
320
+
321
+ steps :
322
+ - uses : actions/checkout@master
323
+ with :
324
+ ref : ${{ github.ref }}
325
+
326
+ - uses : c-hive/gha-yarn-cache@v2
327
+ - name : Setup Golang caches
328
+ uses : actions/cache@v3
329
+ with :
330
+ path : |
331
+ ~/.cache/go-build
332
+ ~/go/pkg/mod
333
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
334
+ restore-keys : |
335
+ ${{ runner.os }}-golang-
336
+
337
+ - run : ./scripts/ci/prepare_windows.ps1
338
+ shell : pwsh
339
+ # Needed so we can have ./build/desktop_runner.js ready for tests
340
+ - run : yarn build-test-runner
341
+ - run : yarn test --detectOpenHandles --forceExit --verbose shared ui desktop
342
+ - run : cd runner && go test -race -cover
343
+ - run : yarn release-desktop 0.0.0-e2etest
344
+ - run : git reset --hard # release blows everything up
345
+ - run : yarn e2e-test
346
+
347
+ server_tests :
348
+ name : Server Tests
349
+ runs-on : ubuntu-latest
350
+
351
+ steps :
352
+ - uses : actions/checkout@master
353
+ with :
354
+ ref : ${{ github.ref }}
355
+
356
+ - uses : c-hive/gha-yarn-cache@v2
357
+ - name : Setup Golang caches
358
+ uses : actions/cache@v3
359
+ with :
360
+ path : |
361
+ ~/.cache/go-build
362
+ ~/go/pkg/mod
363
+ key : ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
364
+ restore-keys : |
365
+ ${{ runner.os }}-golang-
366
+
367
+ - run : ./scripts/ci/prepare_linux.sh
368
+ - run : yarn release-server 0.0.0-test
369
+ - run : sudo apt-get install -y podman
370
+ - run : ./server/scripts/test_release.sh datastation-server-x64-0.0.0-test.tar.gz
0 commit comments