Skip to content

Commit b5db600

Browse files
committed
add reusable lean test workflow
1 parent 8d58626 commit b5db600

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/lean_test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test Lean Evaluation Function
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
lint-module:
7+
type: string
8+
description: "The module to lint"
9+
required: false
10+
default: ""
11+
binary-name:
12+
type: string
13+
description: "The name of the binary"
14+
required: false
15+
default: "evaluation"
16+
outputs:
17+
lean-version:
18+
description: "The version of Lean used to build the project"
19+
value: ${{ jobs.test.outputs.lean-version }}
20+
21+
jobs:
22+
test:
23+
name: Test
24+
runs-on: ubuntu-latest
25+
outputs:
26+
lean-version: ${{ steps.lean_version.outputs.lean_version }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Lean, build, test, and lint
32+
uses: leanprover/lean-action@v1-beta
33+
with:
34+
test: true
35+
lint-module: ${{ inputs.lint-module }}
36+
37+
- name: Get Lean version
38+
id: lean_version
39+
run: |
40+
# expects `lean --version` to output "Lean (version 4.7.0, aarch64-apple-darwin, commit 6fce8f7d5cd1, Release)"
41+
lean_version=$(lean --version | awk -F '[, ]+' '{print $3}')
42+
echo "lean_version=$lean_version" >> "$GITHUB_OUTPUT"
43+
44+
- name: Upload build artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: evaluation_function
48+
path: ./lake/build/bin/${{ inputs.binary-name }}

0 commit comments

Comments
 (0)