|
13 | 13 | - ".github/workflows/build-and-test-rust.yml" |
14 | 14 |
|
15 | 15 | 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 | +
|
16 | 84 | test: |
17 | 85 | runs-on: aligned-runner |
| 86 | + needs: build |
18 | 87 | steps: |
19 | 88 | - name: Checkout code |
20 | | - uses: actions/checkout@v5 |
| 89 | + uses: actions/checkout@v4 |
21 | 90 |
|
22 | 91 | - name: foundry-toolchain |
23 | 92 | uses: foundry-rs/[email protected] |
24 | 93 |
|
| 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 |
25 | 106 |
|
26 | 107 | - name: Cache Rust dependencies |
27 | 108 | uses: actions/cache@v3 |
|
33 | 114 | key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} |
34 | 115 | restore-keys: | |
35 | 116 | ${{ runner.os }}-rust- |
36 | | - |
| 117 | +
|
37 | 118 | - name: Run Batcher tests |
38 | 119 | run: | |
39 | 120 | cd crates |
|
0 commit comments