-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for lean4checker (#5)
Add an input and corresponding step for checking the enviornment with lean4checker. When run with `lean4checker: true`, lean-action automatically detects the toolchain of the package and runs the corresponding version of `lean4checker.` Note, this input is only supported for lean packages on version >= 4.8.0-rc1 due to the change in naming convention of `lean4checker` version tags.
- Loading branch information
1 parent
788e73f
commit de5c38a
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "Checking environment with lean4checker" | ||
|
||
# clone lean4checker | ||
echo "Cloning and building lean4checker" | ||
git clone https://github.com/leanprover/lean4checker | ||
|
||
# build and test lean4checker in a subshell | ||
( | ||
# detect toolchain version from lean-toolchain file | ||
# assumes toolchain is of the form ".*:{VERSION}" (e.g., "leanprover/lean4:v4.8.0-rc1") | ||
toolchain_version=$(< lean-toolchain cut -d: -f 2) | ||
echo "Detected toolchain version: $toolchain_version" | ||
|
||
# checkout version of lean4checker corresponding to toolchain version | ||
cd lean4checker || exit | ||
git config advice.detachedHead false # turn off git warning about detached head | ||
git checkout "$toolchain_version" | ||
cp ../lean-toolchain . | ||
|
||
# build lean4checker and test lean4checker | ||
lake build | ||
./test.sh | ||
) | ||
|
||
# run lean4checker | ||
echo "Running lean4checker" | ||
lake env lean4checker/.lake/build/bin/lean4checker |