Skip to content

perf(ci): cache compiled tests - #1015

Closed
SamuelSchlesinger wants to merge 1 commit into
leanprover:mainfrom
SamuelSchlesinger:samschles/ci-cache-tests
Closed

SamuelSchlesinger wants to merge 1 commit into
leanprover:mainfrom
SamuelSchlesinger:samschles/ci-cache-tests

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Build CslibTests alongside Cslib so compiled tests are included in the CI cache and can be reused by subsequent runs.

Codex assisted with the workflow change and validation.

Build CslibTests alongside Cslib before lean-action saves its cache so subsequent runs can reuse compiled tests. The existing strict lake test step then checks the same build outputs.
@SamuelSchlesinger
SamuelSchlesinger marked this pull request as ready for review October 1, 2026 15:30
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

CI is green! Build + tests took ~10s on the cached rerun versus ~42s on the first run of the same commit, with no test modules recompiled. The full job finished in 4m50s.

@jessealama I wonder what you think of this, or if you have a better way to do it.

@chenson2018

chenson2018 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

This works, but is pretty hacky and is a regression in mixing the test and build reporting. I think what should be done instead is that somewhere around here in lean-action a missing call to actions/cache/save after the (optional) test step is inserted. (Or maybe the one after the build can just move down)

SamuelSchlesinger added a commit to SamuelSchlesinger/lean-action that referenced this pull request Oct 2, 2026
This PR saves the GitHub cache after testing and linting so their build artifacts can be reused, while preserving separate build, test, and lint reporting. It retains caching after test or lint failures and skips saves on exact cache hits.

Based on [Chris's suggestion](leanprover/cslib#1015 (comment)).

Codex assisted with implementation and validation.
austinletson pushed a commit to leanprover/lean-action that referenced this pull request Oct 12, 2026
This PR saves the GitHub cache after testing and linting so their build
artifacts can be reused, while preserving separate build, test, and lint
reporting. It retains caching after test or lint failures and skips
saves on exact cache hits.

Based on [Chris's
suggestion](leanprover/cslib#1015 (comment)).

Codex assisted with implementation and validation.
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.

2 participants