@@ -313,7 +313,7 @@ jobs:
313
313
run : ./scripts/check_unstaged.sh
314
314
315
315
test-go :
316
- runs-on : ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest -16-cores ' || matrix.os }}
316
+ runs-on : ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'depot- windows-2022 -16' || matrix.os }}
317
317
needs : changes
318
318
if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
319
319
timeout-minutes : 20
@@ -337,6 +337,8 @@ jobs:
337
337
338
338
- name : Setup Go
339
339
uses : ./.github/actions/setup-go
340
+ with :
341
+ build-cache-path : ~/.cache/go-build
340
342
341
343
- name : Setup Terraform
342
344
uses : ./.github/actions/setup-tf
@@ -347,6 +349,14 @@ jobs:
347
349
with :
348
350
key-prefix : test-go-${{ runner.os }}-${{ runner.arch }}
349
351
352
+ - name : Download Go Build Cache
353
+ id : download-go-build-cache
354
+ uses : ./.github/actions/test-cache/download
355
+ if : runner.os == 'Windows'
356
+ with :
357
+ key-prefix : test-go-${{ runner.os }}-${{ runner.arch }}-golang
358
+ cache-path : " ~/.cache/go-build"
359
+
350
360
- name : Test with Mock Database
351
361
id : test
352
362
shell : bash
@@ -368,6 +378,7 @@ jobs:
368
378
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
369
379
fi
370
380
export TS_DEBUG_DISCO=true
381
+ export GOCACHE="$(realpath ~/.cache/go-build)"
371
382
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" \
372
383
--packages="./..." -- $PARALLEL_FLAG -short -failfast
373
384
@@ -376,6 +387,14 @@ jobs:
376
387
with :
377
388
cache-key : ${{ steps.download-cache.outputs.cache-key }}
378
389
390
+ - name : Upload Go Build Cache
391
+ if : runner.os == 'Windows'
392
+ uses : ./.github/actions/test-cache/upload
393
+ with :
394
+ cache-key : ${{ steps.download-go-build-cache.outputs.cache-key }}
395
+ cache-path : " ~/.cache/go-build"
396
+ override-condition : " true"
397
+
379
398
- name : Upload test stats to Datadog
380
399
timeout-minutes : 1
381
400
continue-on-error : true
0 commit comments