#32 CI: cache infra/ Go module deps #33

Merged
JMR-dev merged 1 commits from ticket-32-ci-cache-infra into main 2026-07-02 20:02:37 +00:00
JMR-dev commented 2026-07-02 19:54:29 +00:00 (Migrated from github.com)

What

actions/setup-go's built-in module cache (enabled by default) keys the cache on go.sum, but only the root module's go.sum. This job also vets/tests the infra/ module, whose go.sum pulls the heavy Pulumi SDKs (pulumi/sdk, pulumi-cloudflare, pulumi-gcp). Because those weren't part of the cache key, infra/'s deps re-downloaded on every run (~4-5 min CI).

Change

Set cache-dependency-path on the existing Set up Go step to a multiline list covering both go.sum files:

cache-dependency-path: |
  go.sum
  infra/go.sum

setup-go hashes all listed paths into the cache key and caches both ~/go/pkg/mod and the Go build cache, so infra/'s Pulumi deps are restored from cache instead of re-downloaded.

  • Only .github/workflows/ci.yml is touched (10-line addition: comment + 3 config lines).
  • No behavior change: still vets/tests root + infra/, applies the TinyGo net/http patch, and builds the Wasm Worker.
  • Action stays pinned by full commit SHA with its # v6.5.0 comment (repo convention). No new actions added, so no new SHAs to resolve.

Note on the speedup

The cache is populated on the first (cold) run and the speedup lands on subsequent (warm) runs — so the win shows up on the second run of this workflow with the new key, not the first.

Validation

go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/ci.yml — passes clean (exit 0, no findings).

Closes #32

## What `actions/setup-go`'s built-in module cache (enabled by default) keys the cache on `go.sum`, but only the **root** module's `go.sum`. This job also vets/tests the `infra/` module, whose `go.sum` pulls the heavy Pulumi SDKs (`pulumi/sdk`, `pulumi-cloudflare`, `pulumi-gcp`). Because those weren't part of the cache key, `infra/`'s deps re-downloaded on every run (~4-5 min CI). ## Change Set `cache-dependency-path` on the existing **Set up Go** step to a multiline list covering both `go.sum` files: ```yaml cache-dependency-path: | go.sum infra/go.sum ``` `setup-go` hashes all listed paths into the cache key and caches both `~/go/pkg/mod` and the Go build cache, so `infra/`'s Pulumi deps are restored from cache instead of re-downloaded. - Only `.github/workflows/ci.yml` is touched (10-line addition: comment + 3 config lines). - No behavior change: still vets/tests root + `infra/`, applies the TinyGo net/http patch, and builds the Wasm Worker. - Action stays pinned by full commit SHA with its `# v6.5.0` comment (repo convention). No new actions added, so no new SHAs to resolve. ## Note on the speedup The cache is **populated on the first (cold) run** and the speedup lands on **subsequent (warm) runs** — so the win shows up on the second run of this workflow with the new key, not the first. ## Validation `go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/ci.yml` — passes clean (exit 0, no findings). Closes #32
Sign in to join this conversation.