diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e323e618e8..87eaa51632 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -605,8 +605,15 @@ jobs: # Normalize file modification timestamps so that go test can use the # cache from the previous CI run. See https://github.com/golang/go/issues/58571 # for more details. + # + # mtimehash only optimizes cache hits, so a missing binary must not + # fail the job before any tests run (coder/internal#1630). run: | - find . -type f ! -path ./.git/\*\* | mtimehash + if command -v mtimehash >/dev/null 2>&1; then + find . -type f ! -path ./.git/\*\* | mtimehash + else + echo "::warning::mtimehash not found; skipping file timestamp normalization (Go test cache may be cold)" + fi find . -type d ! -path ./.git/\*\* -exec touch -t 200601010000 {} + - name: Normalize Terraform Path for Caching diff --git a/.github/workflows/nightly-gauntlet.yaml b/.github/workflows/nightly-gauntlet.yaml index 0fd61bb9a2..9ca10e1bd0 100644 --- a/.github/workflows/nightly-gauntlet.yaml +++ b/.github/workflows/nightly-gauntlet.yaml @@ -68,6 +68,11 @@ jobs: install-args: "go terraform" - name: Install Go mise tools + # retry.sh is a bash script, so an explicit shell is required for the + # Windows matrix entry. Under the default PowerShell shell the step + # reports success without running the install, so gotestsum is + # silently missing whenever the mise cache misses (coder/internal#1630). + shell: bash run: ./.github/scripts/retry.sh -- mise install --locked go:gotest.tools/gotestsum - name: Setup Embedded Postgres Cache Paths