Skip to content

ci: keep shared caches warm from develop and stop slow steps early - #196

Merged
andersalm merged 1 commit into
developfrom
ci/warm-caches-fail-fast
Oct 1, 2026
Merged

andersalm merged 1 commit into
developfrom
ci/warm-caches-fail-fast

Conversation

@andersalm

Copy link
Copy Markdown
Contributor

Part of #194 (Part 0: CI speed). Measured 1 October: CI wall time median 47 min (p90 56); runners queue for 0.1 min, so time goes into the jobs themselves.

Root cause 1, cache thrash: CI ran on PRs and main only, so caches were saved only in PR scope. A PR can read only its own caches and those of develop or main, and there were none on develop. Each PR saved 6-8 GB under the 10 GB repo cap (PR #188 alone held 8.3 GB), evicting every other PR's caches: the oldest cache was 1 hour old, and test-elastos logged "No cache found".

Root cause 2, wasted and unbounded steps: PR runs rebuilt and packaged release binaries that are uploaded only for tags, main and dispatch (about 7 minutes on macOS), and a stalled apt mirror held one Linux job for 90 minutes.

Changes

  • CI also runs on pushes to develop; only develop and main pushes save caches (rust-cache save-if, actions/cache split into restore and save). PR runs restore and never save.
  • Release packaging is skipped on pull requests; it still runs for develop, main, tags and dispatch.
  • apt and brew steps time out after 15 minutes; apt retries 3 times with a 30-second HTTP timeout.
  • scripts/ci-release-policy-test.py checks that only develop and main pushes save caches (fails when a rust-cache step lacks save-if or a save step ignores the rule).

Not changed: tag builds stay cache-free (#137); jobs, names and required checks stay the same.

Proof after merge: the develop push run saves caches; the next PR run logs "Cache restored" in test-elastos and source-home jobs, and its time is recorded on #194 against the 47-minute baseline.

PR runs restored caches only from their own PR, and every PR saved
multi-GB caches that evicted all others under the 10 GB repo cap, so
nearly every job built cold. Run CI on develop pushes and save caches
only from develop or main; PR runs restore and never save.

Skip release packaging on pull requests: nothing uploads it there, and
setup-source-home already proved the release build. Bound apt and brew
steps to 15 minutes with apt retries instead of the 90-minute job limit.

The CI policy test now checks that only develop and main pushes save.
@andersalm
andersalm merged commit 356839f into develop Oct 1, 2026
9 checks passed
@andersalm
andersalm deleted the ci/warm-caches-fail-fast branch October 1, 2026 23:40
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