Skip to content

Commit 065f649

Browse files
committed
Restore CI
1 parent 91797bd commit 065f649

File tree

1 file changed

+83
-2
lines changed

1 file changed

+83
-2
lines changed

.github/workflows/build-and-test-rust.yml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,96 @@ on:
1313
- ".github/workflows/build-and-test-rust.yml"
1414

1515
jobs:
16+
build:
17+
runs-on: aligned-runner
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Rust
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: 1.86.0
26+
components: rustfmt, clippy
27+
override: true
28+
29+
# Reference: https://github.com/succinctlabs/sp1/actions/runs/8886659400/workflow#L61-L65
30+
- name: Install sp1 toolchain
31+
run: |
32+
curl -L https://sp1.succinct.xyz | bash
33+
source /home/runner/.bashrc
34+
~/.sp1/bin/sp1up
35+
36+
- name: Install risc0 toolchain
37+
run: |
38+
curl -L https://risczero.com/install | bash
39+
source ~/.bashrc
40+
~/.risc0/bin/rzup install
41+
42+
- name: Cache Rust dependencies
43+
uses: actions/cache@v3
44+
with:
45+
path: |
46+
~/.cargo/registry
47+
~/.cargo/git
48+
crates/target
49+
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
50+
restore-keys: |
51+
${{ runner.os }}-rust-
52+
53+
- name: Check formatting
54+
run: |
55+
cd crates
56+
cargo fmt --all -- --check
57+
58+
- name: Run Clippy
59+
run: |
60+
cd crates
61+
cargo clippy --all -- -D warnings
62+
63+
- name: Build Batcher
64+
run: |
65+
cd crates
66+
cargo build --all
67+
68+
- name: Check formatting of AggregationMode
69+
run: |
70+
cd aggregation_mode
71+
cargo fmt --all -- --check
72+
73+
- name: Build AggregationMode # We build before clippy to generate the ELF
74+
run: |
75+
cd aggregation_mode
76+
cargo build --all
77+
78+
- name: Run Clippy on AggregationMode
79+
run: |
80+
cd aggregation_mode
81+
# We need to skip the build as clippy does not support the riscv32im-risc0-zkvm-elf target
82+
RISC0_SKIP_BUILD=1 cargo clippy --all -- -D warnings
83+
1684
test:
1785
runs-on: aligned-runner
86+
needs: build
1887
steps:
1988
- name: Checkout code
20-
uses: actions/checkout@v5
89+
uses: actions/checkout@v4
2190

2291
- name: foundry-toolchain
2392
uses: foundry-rs/[email protected]
2493

94+
# Reference: https://github.com/succinctlabs/sp1/actions/runs/8886659400/workflow#L61-L65
95+
- name: Install sp1 toolchain
96+
run: |
97+
curl -L https://sp1.succinct.xyz | bash
98+
source /home/runner/.bashrc
99+
~/.sp1/bin/sp1up
100+
101+
- name: Install risc0 toolchain
102+
run: |
103+
curl -L https://risczero.com/install | bash
104+
source ~/.bashrc
105+
~/.risc0/bin/rzup install
25106
26107
- name: Cache Rust dependencies
27108
uses: actions/cache@v3
@@ -33,7 +114,7 @@ jobs:
33114
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
34115
restore-keys: |
35116
${{ runner.os }}-rust-
36-
117+
37118
- name: Run Batcher tests
38119
run: |
39120
cd crates

0 commit comments

Comments
 (0)