@@ -370,15 +370,19 @@ jobs:
370
370
api-key : ${{ secrets.DATADOG_API_KEY }}
371
371
372
372
test-go-pg :
373
- runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
374
- needs :
375
- - changes
373
+ runs-on : ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
374
+ needs : changes
376
375
if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
377
376
# This timeout must be greater than the timeout set by `go test` in
378
377
# `make test-postgres` to ensure we receive a trace of running
379
378
# goroutines. Setting this to the timeout +5m should work quite well
380
379
# even if some of the preceding steps are slow.
381
380
timeout-minutes : 25
381
+ strategy :
382
+ matrix :
383
+ os :
384
+ - ubuntu-latest
385
+ - windows-2022
382
386
steps :
383
387
- name : Harden Runner
384
388
uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
@@ -400,8 +404,31 @@ jobs:
400
404
env :
401
405
POSTGRES_VERSION : " 13"
402
406
TS_DEBUG_DISCO : " true"
407
+ shell : bash
403
408
run : |
404
- make test-postgres
409
+ # if macOS, install google-chrome for scaletests
410
+ # As another concern, should we really have this kind of external dependency
411
+ # requirement on standard CI?
412
+ if [ "${{ matrix.os }}" == "macos-latest" ]; then
413
+ brew install google-chrome
414
+ fi
415
+
416
+ # By default Go will use the number of logical CPUs, which
417
+ # is a fine default.
418
+ PARALLEL_FLAG=""
419
+
420
+ # macOS will output "The default interactive shell is now zsh"
421
+ # intermittently in CI...
422
+ if [ "${{ matrix.os }}" == "macos-latest" ]; then
423
+ touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
424
+ fi
425
+
426
+ if [ "${{ runner.os }}" == "Linux" ]; then
427
+ make test-postgres
428
+ else
429
+ go run scripts/embedded-pg/main.go
430
+ DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./...
431
+ fi
405
432
406
433
- name : Upload test stats to Datadog
407
434
timeout-minutes : 1
@@ -410,6 +437,7 @@ jobs:
410
437
if : success() || failure()
411
438
with :
412
439
api-key : ${{ secrets.DATADOG_API_KEY }}
440
+
413
441
414
442
# NOTE: this could instead be defined as a matrix strategy, but we want to
415
443
# only block merging if tests on postgres 13 fail. Using a matrix strategy
0 commit comments