Skip to content

Commit 3a79e3a

Browse files
committed
enable test-go-pg on windows
1 parent cd38962 commit 3a79e3a

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,19 @@ jobs:
370370
api-key: ${{ secrets.DATADOG_API_KEY }}
371371

372372
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
376375
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
377376
# This timeout must be greater than the timeout set by `go test` in
378377
# `make test-postgres` to ensure we receive a trace of running
379378
# goroutines. Setting this to the timeout +5m should work quite well
380379
# even if some of the preceding steps are slow.
381380
timeout-minutes: 25
381+
strategy:
382+
matrix:
383+
os:
384+
- ubuntu-latest
385+
- windows-2022
382386
steps:
383387
- name: Harden Runner
384388
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
@@ -400,8 +404,31 @@ jobs:
400404
env:
401405
POSTGRES_VERSION: "13"
402406
TS_DEBUG_DISCO: "true"
407+
shell: bash
403408
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
405432
406433
- name: Upload test stats to Datadog
407434
timeout-minutes: 1
@@ -410,6 +437,7 @@ jobs:
410437
if: success() || failure()
411438
with:
412439
api-key: ${{ secrets.DATADOG_API_KEY }}
440+
413441

414442
# NOTE: this could instead be defined as a matrix strategy, but we want to
415443
# only block merging if tests on postgres 13 fail. Using a matrix strategy

0 commit comments

Comments
 (0)