CI: cache infra/ Go module deps (Pulumi SDKs) to speed up runs #32

Closed
opened 2026-07-02 19:52:20 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-02 19:52:20 +00:00 (Migrated from github.com)

Context

The ci workflow's "Vet and test infra module" step runs go vet/go test in infra/, which pulls the Pulumi Go SDKs (pulumi/sdk, pulumi-cloudflare, pulumi-gcp — large). actions/setup-go's built-in cache keys on the ROOT go.sum only, so infra/go.sum's dependencies are re-downloaded on every run — making each ci run ~4-5 min (vs ~1.5 min before infra existed). This slows every PR, and strict-mode re-syncs re-run CI repeatedly.

The #3 CI author explicitly anticipated this: "When #2 adds infra/go.mod+go.sum, setup-go's cache key (currently keyed on root go.sum) may warrant extending."

Scope

  • Extend Go module caching so infra/go.sum deps are cached across runs — e.g. set actions/setup-go cache-dependency-path to cover BOTH go.sum and infra/go.sum, or add an explicit actions/cache for the Go build/module cache keyed on both go.sum files.
  • Keep all actions pinned by commit SHA (repo convention).

Acceptance criteria

  • After a warm cache, subsequent ci runs do not re-download the Pulumi SDKs and run meaningfully faster; ci stays green.

Notes

Workflow-only change (.github/workflows/ci.yml); no application code. Non-blocking optimization.

## Context The `ci` workflow's "Vet and test infra module" step runs `go vet`/`go test` in `infra/`, which pulls the Pulumi Go SDKs (`pulumi/sdk`, `pulumi-cloudflare`, `pulumi-gcp` — large). `actions/setup-go`'s built-in cache keys on the ROOT `go.sum` only, so `infra/go.sum`'s dependencies are re-downloaded on **every** run — making each `ci` run ~4-5 min (vs ~1.5 min before infra existed). This slows every PR, and strict-mode re-syncs re-run CI repeatedly. The #3 CI author explicitly anticipated this: "When #2 adds `infra/go.mod`+`go.sum`, setup-go's cache key (currently keyed on root `go.sum`) may warrant extending." ## Scope - [ ] Extend Go module caching so `infra/go.sum` deps are cached across runs — e.g. set `actions/setup-go` `cache-dependency-path` to cover BOTH `go.sum` and `infra/go.sum`, or add an explicit `actions/cache` for the Go build/module cache keyed on both go.sum files. - [ ] Keep all actions pinned by commit SHA (repo convention). ## Acceptance criteria - After a warm cache, subsequent `ci` runs do not re-download the Pulumi SDKs and run meaningfully faster; `ci` stays green. ## Notes Workflow-only change (`.github/workflows/ci.yml`); no application code. Non-blocking optimization.
Sign in to join this conversation.