Commit ec4726b
authored
BUILD: Speed up GoReleaser in PR builds with --single-target --skip=before (#4167)
The main bottleneck in the PR CI/CD pipeline is the `goreleaser build
--snapshot` step, which takes \~8m19s out of the total \~10m45s ([run
23057743439](https://github.com/StackExchange/dnscontrol/actions/runs/23057743439)).
| **Step** | **Duration** |
| --- | --- |
| Unit tests | 1m 46s |
| Build binaries (not tagged) | 8m 19s |
| Rest (setup, cache, etc.) | \~10s |
Two things make it slow:
1. **Cross-compilation for all 8 targets** (linux, windows, darwin,
freebsd x amd64/arm64). For a PR build, we only need to verify the code
compiles.
2. **Before hooks** (`go fmt ./...`, `go mod tidy`, `go generate ./...`)
run every time, but are redundant in CI -- formatting/tidy should
already be done, and `go generate` is covered by the stringer install
step.
This PR adds `--single-target` and `--skip=before` to the snapshot
build, which should bring the GoReleaser step from \~8 minutes down to
\~1 minute. The full release build (on tag) remains unchanged.
Fixes #41651 parent 92d4efa commit ec4726b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
0 commit comments