@@ -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
@@ -335,8 +335,25 @@ jobs:
335
335
with :
336
336
fetch-depth : 1
337
337
338
+ - name : Download Go Build Cache
339
+ id : download-go-build-cache
340
+ uses : ./.github/actions/test-cache/download
341
+ if : runner.os == 'Windows'
342
+ with :
343
+ key-prefix : test-go-build-11-${{ runner.os }}-${{ runner.arch }}
344
+ cache-path : " ~/.cache/go-cache"
345
+
338
346
- name : Setup Go
339
347
uses : ./.github/actions/setup-go
348
+ with :
349
+ build-cache-path : ~/.cache/go-cache
350
+ cache : false
351
+
352
+ - name : Normalize File and Directory Timestamps
353
+ shell : bash
354
+ run : |
355
+ find . -type f ! -path ./.git/\*\* | mtimehash
356
+ find . -type d ! -path ./.git/\*\* -exec touch -t 200601010000 {} +
340
357
341
358
- name : Setup Terraform
342
359
uses : ./.github/actions/setup-tf
@@ -368,6 +385,9 @@ jobs:
368
385
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
369
386
fi
370
387
export TS_DEBUG_DISCO=true
388
+ export GOCACHE=~/.cache/go-cache/build
389
+ export GOMODCACHE=~/.cache/go-cache/mod
390
+ echo "PATH: $PATH"
371
391
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" \
372
392
--packages="./..." -- $PARALLEL_FLAG -short -failfast
373
393
@@ -376,6 +396,14 @@ jobs:
376
396
with :
377
397
cache-key : ${{ steps.download-cache.outputs.cache-key }}
378
398
399
+ - name : Upload Go Build Cache
400
+ if : runner.os == 'Windows'
401
+ uses : ./.github/actions/test-cache/upload
402
+ with :
403
+ cache-key : ${{ steps.download-go-build-cache.outputs.cache-key }}-${{ github.run_id }}-${{ github.run_attempt }}
404
+ cache-path : " ~/.cache/go-cache"
405
+ override-condition : " true"
406
+
379
407
- name : Upload test stats to Datadog
380
408
timeout-minutes : 1
381
409
continue-on-error : true
0 commit comments