leanprover / leanprover/lean-action
Adopt setup + post-step cache pattern (don't run commands in the action)
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 45
- Forks
- 22
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 1
Description
Problem
The action currently runs Lake commands (build, lint, mathlib cache) and saves the cache during its own execution, before any user-defined steps run. This means artifacts produced by subsequent steps (the user's own lake build, tests, etc.) are never cached.
Users who set build: false and run their own commands get no benefit from the cache — every CI run rebuilds from scratch.
Precedent: Gradle Actions
gradle/actions had the exact same problem. The original action ran Gradle commands and cached before user steps. They redesigned it into setup-gradle:
- Setup step: Install Gradle + restore cache
- Post step: Save cache (after all user steps complete)
This ensures the cache always reflects the final build state.
Proposal
The action's core responsibilities should be:
- Setup step: Install the Lean toolchain + restore cache
- Post step: Save cache after all user steps have run
Everything else — lake build, lake lint — should be the user's own workflow steps.
- uses: leanprover/lean-action@v2
with:
lake-package-directory: packages
# User controls what runs
- run: make build
- run: make lint
- run: make test
# Post step (automatic): lean-action saves the cache
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the action's current setup, Lean command execution, and cache restore/save flow. Separate setup and post-step responsibilities so user-defined build, lint, and test steps run before cache saving; done means the action restores during setup and saves the final state afterward without running those commands itself.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, shell
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100