Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub Actions to check that building succeeds #11

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

Coda-Coda
Copy link
Collaborator

@Coda-Coda Coda-Coda commented Oct 7, 2024

Hi, this adds a GitHub Action which runs lake build and stack build.
It will run automatically for pull requests to main or pushes to main.
It uses Nix to obtain the build inputs declared in flake.nix (currently elan and stack).
It caches the Lean toolchain and Lean packages (important especially since mathlib takes about 1 hour to build through GitHub Actions). It gets Mathlib using lake 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 and stack build (in vc) are successful.

For this, it also adds a flake.nix with a devShell including elan and stack. The idea is to use elan to install lean rather than directly using Nix due to complications packaging mathlib 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: the lake exe cache get idea was taken from blank.yml].

@Coda-Coda Coda-Coda force-pushed the build-with-GitHub-Actions branch from 7ad842f to 3110dc9 Compare October 7, 2024 03:34
Daniel Britten added 2 commits October 11, 2024 13:28
The idea is that `elan` should be used to install `lean` rather than directly using Nix, because of issues with packaging `mathlib` such as discussed here: leanprover/lean4#5122.
Runs automatically for pull requests to `main` or pushes to `main`.
Uses Nix to obtain the packages declared in `shell.nix` (`elan` and `stack`).
Caches Lean toolchain and Lean packages, retrieving Mathlib via `lake exe cache get` if not already in the GitHub Actions cache.
@Coda-Coda Coda-Coda force-pushed the build-with-GitHub-Actions branch from 3110dc9 to 099f6e0 Compare October 11, 2024 00:55
@Coda-Coda
Copy link
Collaborator Author

Switched to shell.nix.

@Coda-Coda Coda-Coda merged commit a20c24e into main Oct 16, 2024
1 check passed
@Coda-Coda Coda-Coda deleted the build-with-GitHub-Actions branch October 16, 2024 02:04
@Coda-Coda Coda-Coda restored the build-with-GitHub-Actions branch October 21, 2024 22:47
@Coda-Coda Coda-Coda deleted the build-with-GitHub-Actions branch December 5, 2024 04:41
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