Skip to content

ci: stop the cache eviction and skip builds for files that CI does not read - #1760

Merged
lukasIO merged 1 commit into
mainfrom
claude/ci-cache-and-filter
Dec 2, 2026
Merged

lukasIO merged 1 commit into
mainfrom
claude/ci-cache-and-filter

Conversation

@lukasIO

@lukasIO lukasIO commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

A CI run takes 33 minutes and about 405 job-minutes. That is the median of 90 runs from 2026-11-26 to 2026-12-01. Almost each job builds from zero, because the caches evict each other. A second cost: a PR that changes only files that cargo does not read runs the full build matrix.

Change

No cache of target/. builds.yml, tests.yml and ffi-builds.yml no longer save target/ with actions/cache.

  • One run saved 16 target/ caches, 12 GB in total. A repository can keep 10 GB.
  • GitHub evicted every cache within minutes. The oldest entry in the repository was 15 minutes old.
  • The sccache objects, 2 GB in total, were evicted too. The sccache hit rate was 0% and 0.2% on two Linux jobs and 15% on an iOS job.
  • Each job spent 0.5 to 1 minute on the upload of a cache that no job read.

sccache and the cache of the cargo registry stay. The runs on main fill sccache, and each PR can read those objects.

A narrower core filter. The build, test and feature-combination jobs no longer start for a PR that changes only these files:

  • verwalter.toml and the two scripts of the release
  • workflows that the three jobs do not call, for example release.yml, ffi-builds.yml and uniffi-*.yml
  • pnpm-lock.yaml, pnpm-workspace.yaml and the package.json files of the Node bindings
  • Gradle files

The list names files, so a new file runs the jobs. Each push to main runs them without the filter. The formatting, license, changeset and API test jobs do not use this filter and run as before.

Verified

  • The new filter against the files of seven real PRs, with a script that follows the rules of the filter action. The Gradle and npm PRs of Renovate (Update gradle dependencies #1207, Update npm dependencies #1306) and three release workflow PRs skip the jobs. The Renovate PR for GitHub actions (Update github actions #1756) and a source PR (support for token mode #1715) run them.
  • Each new pattern matches only the files that it names. No pattern matches a Rust source file or a cargo manifest.
  • livekit-ffi-node-bindings/build.rs calls napi_build::setup() only. No Rust build script names a Gradle or package file.
  • actionlint passes on the four changed workflows.

Not done yet

  • The gain is not measured. sccache needs some runs on main after the merge to fill. The first runs of this PR are cold too.
  • node-builds.yml, uniffi-dart-publish.yml and uniffi-dart-test.yml keep their target/ cache. The first two run only for a release. The Dart test saves one cache.
  • The script for the filter test is my own. It follows the documented rules, but it is not the code of the filter action.
  • Three other findings of the audit are not in this PR. They are release builds with full LTO on each PR, tests on one thread, and feature combinations on 11 targets.

🤖 Generated with Claude Code

…not read

- Remove the `target/` cache from builds.yml, tests.yml and
  ffi-builds.yml. One run saved 16 caches with 12 GB in total, and a
  repository can keep 10 GB. GitHub evicted every cache within minutes,
  the sccache objects too, so each job built from zero.
- The `core` filter of ci.yml no longer matches files that no build,
  test or feature-combination job reads: the release configuration,
  workflows that these jobs do not call, package files of the Node
  bindings, and Gradle files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lukasIO
lukasIO requested a review from ladvoc as a code owner December 1, 2026 10:22
@lukasIO lukasIO added the internal to tag changes that don't require changelog documentation label Dec 1, 2026
@lukasIO lukasIO self-assigned this Dec 1, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@lukasIO
lukasIO merged commit de20852 into main Dec 2, 2026
41 of 48 checks passed
@lukasIO
lukasIO deleted the claude/ci-cache-and-filter branch December 2, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal to tag changes that don't require changelog documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants