Skip to content

Speed up CI: cache deps, ccache, changed-file clang-tidy - #19

Merged
jwinarske merged 1 commit into
mainfrom
jw/ci-speedup
Jul 12, 2026
Merged

Speed up CI: cache deps, ccache, changed-file clang-tidy#19
jwinarske merged 1 commit into
mainfrom
jw/ci-speedup

Conversation

@jwinarske

Copy link
Copy Markdown
Owner

Speeds up CI without reducing coverage. The workflow currently rebuilds the sdbus-c++ submodule from source in every build job, reinstalls the apt/LLVM toolchain on every run, and runs clang-tidy over the whole tree on every PR.

Changes

  • Concurrency group (cancel-in-progress) — a new push to a PR cancels the in-flight run instead of letting it finish.
  • apt package caching via awalsh128/cache-apt-pkgs-action in every job. The heaviest case is the LLVM-19 set from apt.llvm.org (the repo is still added first so the packages resolve). Tag-pinned @v1, matching the convention already used in the drm-cxx sibling repo.
  • ccache in the build matrix (hendrikmuhs/ccache-action + CMAKE_*_COMPILER_LAUNCHER=ccache). The pinned submodules never change between runs, so their object files hit the cache after the first run.
  • clang-tidy scoped to changed files on PRs. A pull_request run now tidies only the .cc translation units the PR touches, in parallel; push to main still tidies the whole tree so cross-file regressions are caught on merge. The redundant --version / --help / --dump-config invocations are removed.
  • CodeQL: LTO off. LTO adds link-time cost with no analysis value. ccache is intentionally not used in the CodeQL job — its extractor must observe real compiler invocations, which a cache hit would skip.

Notes

  • Build lanes keep ENABLE_LTO=ON so the published artifacts are unchanged; ccache still caches the compile step under LTO.
  • The two new third-party actions are tag-pinned (@v1) to match drm-cxx; if you'd prefer they be SHA-pinned like actions/* here, say so and I'll pin them.
  • First main run after merge primes the apt/ccache caches; the speedup lands on subsequent runs.

- Cancel superseded runs on the same ref via a concurrency group.
- Cache apt packages with cache-apt-pkgs-action across every job, so the
  toolchain and dev headers (including the apt.llvm.org LLVM set) are not
  re-downloaded each run.
- Route the build matrix compiles through ccache; the pinned submodules
  (sdbus-c++, spdlog, glaze) do not change, so they hit the cache after the
  first run.
- clang-tidy: on a pull_request, tidy only the .cc files the PR changes,
  in parallel; push-to-main still tidies the whole tree as the regression
  net. Drop the redundant --version/--help/--dump-config invocations.
- CodeQL: disable LTO for its build (link-time cost with no analysis value).
  ccache is deliberately not used here so the extractor still observes real
  compiler invocations.

Signed-off-by: Joel Winarske <[email protected]>
@jwinarske
jwinarske merged commit 6aa2d6b into main Jul 12, 2026
6 checks passed
@jwinarske
jwinarske deleted the jw/ci-speedup branch July 12, 2026 20:42
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