Skip to content

Commit bd851cb

Browse files
authored
chore: add consistency check workflow file (#5)
1 parent e5d4eee commit bd851cb

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/consistency.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: OpenVM Repo Consistency Check
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to check"
8+
required: true
9+
10+
env:
11+
VERSION: ${{ github.event.inputs.version }}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.inputs.version }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
consistency-check:
19+
runs-on:
20+
- runs-on=${{ github.run_id }}
21+
- family=m7a.24xlarge
22+
- disk=large
23+
24+
steps:
25+
- name: Checkout current repo
26+
uses: actions/checkout@v4
27+
28+
- name: Extract major.minor into TRUNC_VERSION
29+
id: extract
30+
run: echo "TRUNC_VERSION=$(echo '${{ env.VERSION }}' | cut -d '.' -f1-2)" >> "$GITHUB_ENV"
31+
32+
- name: Install solc # svm should support arm64 linux
33+
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
34+
35+
- name: Clone openvm at tag
36+
run: |
37+
git clone https://github.com/openvm-org/openvm.git
38+
cd openvm
39+
git checkout ${VERSION}
40+
41+
- name: Run openvm setup
42+
run: |
43+
cd openvm/crates
44+
cargo run --bin cargo-openvm openvm setup
45+
46+
- name: Install Foundry
47+
uses: foundry-rs/foundry-toolchain@v1
48+
49+
- name: Compare output to version folder
50+
run: |
51+
diff -r ~/.openvm/halo2/src/${TRUNC_VERSION} src/${TRUNC_VERSION} --exclude=verifier.bytecode.json
52+
53+
- name: Compare compiled bytecode in repo to verifier.bytecode.json
54+
run: |
55+
forge build --force
56+
diff <(jq -r '.bytecode.object | ltrimstr("0x")' out/OpenVmHalo2Verifier.sol/OpenVmHalo2Verifier.json) <(jq -r '.bytecode | ltrimstr("0x")' ~/.openvm/halo2/src/${TRUNC_VERSION}/verifier.bytecode.json)

0 commit comments

Comments
 (0)