Use GitHub Actions to check that building succeeds #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this adds a GitHub Action which runs
lake build
andstack build
.It will run automatically for pull requests to
main
or pushes tomain
.It uses Nix to obtain the build inputs declared in
flake.nix
(currentlyelan
andstack
).It caches the Lean toolchain and Lean packages (important especially since
mathlib
takes about 1 hour to build through GitHub Actions). It gets Mathlib usinglake exe cache get
if there is not GitHub Actions cache hit. [Note: I previously didn't realise getting Mathlib like this was possible, hence the new commit force-pushed].The aim is to just check that
lake build
andstack build
(invc
) are successful.For this, it also adds a
flake.nix
with adevShell
includingelan
andstack
. The idea is to useelan
to installlean
rather than directly using Nix due to complications packagingmathlib
in Nix such as discussed in leanprover/lean4#5122 and keeping the setup instructions unchanged.I've experimented with this in the
add-CI-2
branch of my fork.This is the first run (7m58s): https://github.com/Coda-Coda/Nethermind-Clear/actions/runs/11208110827.
This is the next run (6m9s), after a minor test edit to
EVMState.lean
to test out rebuilding: https://github.com/Coda-Coda/Nethermind-Clear/actions/runs/11208261568.The caching seems to be working as expected, giving a slightly faster build time.
I noticed that there was an old
blank.yml
file seemingly from a previous approach to using GitHub Actions: https://github.com/NethermindEth/Clear/blob/2ac080b162279dd99813c08ce937dab05cdea3a4/.github/workflows/blank.yml. It may be helpful to add aspects of that in, however this pull request takes a simpler approach. [Note: thelake exe cache get
idea was taken fromblank.yml
].