|
|
|
@@ -297,23 +297,6 @@ style conventions are in separate documents:
|
|
|
|
|
- the settings
|
|
|
|
|
- the golangci-lint version
|
|
|
|
|
|
|
|
|
|
- **Check builds use Docker's normal cache.** On an unchanged tree Docker reuses
|
|
|
|
|
each step's stored result, and it stores a result only for a step that
|
|
|
|
|
succeeded. A step runs again when one of these changes:
|
|
|
|
|
- the base image
|
|
|
|
|
- its own line or a line above it
|
|
|
|
|
- the files copied before it
|
|
|
|
|
|
|
|
|
|
Nothing needs to run again on an unchanged tree. Never prune the build cache
|
|
|
|
|
(`docker builder prune` and the like): it is shared with every other build
|
|
|
|
|
on the host. When a check is added or changed, prove it works:
|
|
|
|
|
- plant a defect it must catch
|
|
|
|
|
- watch the run fail on it
|
|
|
|
|
- revert the defect
|
|
|
|
|
|
|
|
|
|
A green run alone shows neither that the check ran nor that it covers what
|
|
|
|
|
it should.
|
|
|
|
|
|
|
|
|
|
- **The gate phases are separate stages, and the build stage depends on both.**
|
|
|
|
|
The lint phase is based on the `golangci/golangci-lint` image (pinned by
|
|
|
|
|
hash), so lint failures surface in seconds rather than after a full compile.
|
|
|
|
@@ -617,8 +600,7 @@ style conventions are in separate documents:
|
|
|
|
|
A new push then cancels the older run on the same branch, queued or running,
|
|
|
|
|
and no other: runs for replaced commits do not hold up the shared runner.
|
|
|
|
|
`script/cibuild` bootstraps, runs the gate phases, and then builds the image,
|
|
|
|
|
so a successful run means every check passed. The image build reuses the gate
|
|
|
|
|
phases that the check has just built. The `check` job sets
|
|
|
|
|
so a successful run means every check passed. The `check` job sets
|
|
|
|
|
`timeout-minutes: 20`, so a hung build frees the shared runner after 20
|
|
|
|
|
minutes. That allows for the three Docker builds described above, each held to
|
|
|
|
|
the 5-minute Docker build limit below, plus the bootstrap. Those builds are
|
|
|
|
@@ -732,13 +714,13 @@ style conventions are in separate documents:
|
|
|
|
|
tests. It leaves the build cache alone, so it costs the runtime of the suite
|
|
|
|
|
and no recompilation.
|
|
|
|
|
|
|
|
|
|
That cache is Go's own, separate from Docker's layer cache. Go stores a
|
|
|
|
|
passing result in its cache directory (`GOCACHE`). When the same tests run
|
|
|
|
|
again on unchanged code, it prints that result, marked `(cached)`, without
|
|
|
|
|
running them. The directory lasts from one run to the next on a developer's
|
|
|
|
|
machine, where this target runs. The directory also lasts in the `test`
|
|
|
|
|
phase of the `Dockerfile`, which mounts it to keep compiled packages between
|
|
|
|
|
check builds, so the phase's `go test` runs carry `-count=1` too.
|
|
|
|
|
That cache is Go's own. Go stores a passing result in its cache directory
|
|
|
|
|
(`GOCACHE`). When the same tests run again on unchanged code, it prints that
|
|
|
|
|
result, marked `(cached)`, without running them. The directory lasts from
|
|
|
|
|
one run to the next on a developer's machine, where this target runs. The
|
|
|
|
|
directory also lasts in the `test` phase of the `Dockerfile`, which mounts
|
|
|
|
|
it to keep compiled packages between check builds, so the phase's `go test`
|
|
|
|
|
runs carry `-count=1` too.
|
|
|
|
|
|
|
|
|
|
Python example:
|
|
|
|
|
|
|
|
|
|