Skip to content

ci: make CI/CodeQL lightweight and trigger only when required#124

Merged
xunholy merged 1 commit into
mainfrom
ci/lightweight-triggers
Jun 25, 2026
Merged

ci: make CI/CodeQL lightweight and trigger only when required#124
xunholy merged 1 commit into
mainfrom
ci/lightweight-triggers

Conversation

@xunholy

@xunholy xunholy commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

Makes CI/CodeQL lightweight and trigger only when needed. Recent history was ~45 CI + ~45 CodeQL per 100 runs — roughly half redundant — plus a 5-way cross-compile matrix on every event and the full Go pipeline even on docs-only PRs.

Why it's safe: main has no branch protection / rulesets and no required status checks (PRs merge today even with dependency-review red), so changing triggers/jobs doesn't affect merge-ability. release.yaml is untouched, so the cosign keyless identity (pinned to release.yaml) is preserved.

Changes

  • CI → pull_request only (dropped push: main). main advances only via squash PRs, so the post-merge run just re-validated the diff the PR already passed.
  • CodeQL → pull_request + existing weekly schedule (dropped push: main); the weekly run covers main-branch drift.
  • Removed the per-PR cross-compile matrix. release.yaml already builds all 5 platforms (darwin/windows/linux/arm64) on every tag, so per-PR cross-compile was duplicate work. Trade-off: a platform-specific break surfaces at release, not on the PR.
  • concurrency: cancel-in-progress on both — a new commit on a PR cancels its superseded in-flight run.
  • paths-ignore (**.md, docs/**, LICENSE, .github/assets/**) — docs-only PRs skip the Go pipeline entirely.
  • Minor: dropped -v from go test; pinned govulncheck@v1.4.0 (reproducible + cache-served) instead of @latest.

Net effect

A typical code PR: ~10 runner-jobs (+~10 again on merge) → ~4 (build/lint/vuln/dependency-review), no post-merge run. Docs-only PR → 0. Roughly a 70–80% cut in CI minutes. (Release macOS cost is structural — darwin needs CGO — so the lever there is batching releases, not this workflow.)

Verification

  • actionlint clean on both files.

CI and CodeQL ran on both pull_request and push:main, and CI ran a 5-way
cross-compile matrix on every event. Because main only advances through
squash PRs, the post-merge run re-validated the exact diff the PR already
passed, and the cross-compile matrix duplicated what release.yaml already
builds for every platform on each tag. Recent run history was ~45 CI +
~45 CodeQL per 100 runs, roughly half of it redundant, plus 5 extra
cross-compile runners per change and the full Go matrix even on
docs-only PRs.

Changes (no required status checks exist on main, so trigger/job changes
don't affect merge-ability; release.yaml is untouched so the cosign
keyless identity is preserved):

- CI: pull_request only (dropped push:main). The PR run is the gate.
- CodeQL: pull_request + the existing weekly schedule (dropped push:main);
  the weekly run covers main-branch drift.
- Removed the per-PR cross-compile job. Per-platform build coverage
  (darwin/windows/arm64) lives in release.yaml, which builds every target
  on each tag.
- Added concurrency cancel-in-progress to both, so a new commit on a PR
  cancels its superseded in-flight run.
- paths-ignore (**.md, docs/**, LICENSE, .github/assets/**) so
  documentation-only PRs skip the Go pipeline entirely.
- Minor: dropped `-v` from `go test` (log bloat) and pinned govulncheck
  to v1.4.0 instead of @latest (reproducible + served from the module
  cache).

Net effect: a typical code PR drops from ~10 runner-jobs (+~10 again on
merge) to ~4 (build/lint/vuln/dependency-review) with no post-merge run,
and a docs-only PR to ~0 — roughly a 70-80% cut in CI minutes.

Validated with actionlint (both files clean).
@xunholy xunholy merged commit f1929a0 into main Jun 25, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant