leanprover/Lean Action - CI for Lean Projects

Standard CI for Lean projects. Steps: - install elan - get Mathlib cache (optional, must be downstream of Mathlib) - lake build - lake test (optional) - lake exe runLinter (optional, must be downstream of Batteries) - check reservoir eligibility (optional) - check environment with leanchecker (optional)

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Apr 22, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
auto-configAutomatically configure `lean-action` based on the Lake workspace. When set to "true", `lean-action` will use the Lake workspace to determine the set of features to run on the repository, such as `lake build` and `lake test`. Even when set to "true", the user can still override the auto configuration with the `build` and `test` inputs. Allowed values: "true" or "false". notrue
buildRun `lake build`. Note, this input takes precedence over `auto-config`. Allowed values: "true" | "false" | "default". nodefault
testRun `lake test`. Note, this input takes precedence over `auto-config`. Allowed values: "true" | "false" | "default". nodefault
lintRun `lake lint`. Note, this input takes precedence over `auto-config`. Allowed values: "true" | "false" | "default". nodefault
mk_all-checkCheck all files are imported with `lake exe mk_all --check`. Allowed values: "true" | "false" nofalse
build-argsBuild arguments to pass to `lake build {build-args}`. For example, `build-args: "--quiet"` will run `lake build --quiet`. By default, `lean-action` calls `lake build` with no arguments. no""
test-argsTest arguments to pass to `lake test {test-args}`. For example, `test-args: "--quiet"` will run `lake test --quiet`. By default, `lean-action` calls `lake test` with no arguments. no""
use-mathlib-cacheBy default, `lean-action` attempts to automatically detect a Mathlib dependency and run `lake exe cache get` accordingly. Setting `use-mathlib-cache` will override automatic detection and run (or not run) `lake exe cache get`. Project must be downstream of Mathlib to use the Mathlib cache. Allowed values: "true" | "false" | "auto". noauto
check-reservoir-eligibilityCheck if the repository is eligible for the Reservoir. Allowed values: "true" | "false". nofalse
leancheckerCheck environment with leanchecker. Uses the bundled `leanchecker` binary on Lean `nightly-2026-01-09` / `v4.28.0-rc1` and newer. Falls back to building the external `lean4checker` repository on older Lean versions. Allowed values: "true" | "false". nofalse
lean4checkerDeprecated alias for `leanchecker`. Uses the bundled `leanchecker` binary on Lean `nightly-2026-01-09` / `v4.28.0-rc1` and newer. Falls back to building the external `lean4checker` repository on older Lean versions. Allowed values: "true" | "false". nofalse
nanodaCheck environment with nanoda external type checker. nanoda is an independent Lean 4 type checker written in Rust. Requires Rust toolchain (will be installed automatically if not present). Allowed values: "true" | "false". nofalse
nanoda-allow-sorryWhen running nanoda, permit the sorryAx axiom. Set to "false" if your project should have no sorry placeholders. Allowed values: "true" | "false". notrue
use-github-cacheEnable GitHub caching. Allowed values: "true" or "false". If use-github-cache input is not provided, `lean-action` will use GitHub caching by default. notrue
lake-package-directoryThe directory where `lean-action` will look for a Lake package and run `lake build`, etc. Allowed values: a valid directory containing a Lake package. If lake-package-directory is not provided, `lean-action` will use the root directory of the repository by default. no.
reinstall-transient-toolchainWhen the `lean-toolchain` file specifies a `lean-pr-release` toolchain, uninstall it before running any `lake` commands. This ensures the latest build of the toolchain will be downloaded and used to run CI steps. Allowed values: "true" | "false". nofalse
namedescription
build-statusThe status of the `lake build` step. Allowed values: "SUCCESS" | "FAILURE" | "".
test-statusThe status of the `lake test` step. Allowed values: "SUCCESS" | "FAILURE" | "".
lint-statusThe status of the `lake lint` step. Allowed values: "SUCCESS" | "FAILURE" | "".
mk_all-statusThe status of the `lake exe mk_all --check` step. Allowed values: "SUCCESS" | "FAILURE" | "".
detected-mathlibIf lean-action detected a mathlib dependency equals "true" otherwise equals "false".
nanoda-statusThe status of the nanoda check step. Allowed values: "SUCCESS" | "FAILURE" | "".