|
13 | 13 | - ".github/workflows/build-and-test-rust.yml" |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - build: |
17 | | - runs-on: aligned-runner |
18 | | - env: |
19 | | - CARGO_INCREMENTAL: 0 |
20 | | - |
21 | | - steps: |
22 | | - - uses: actions/checkout@v4 |
23 | | - |
24 | | - - name: Set up Rust |
25 | | - uses: actions-rs/toolchain@v1 |
26 | | - with: |
27 | | - toolchain: 1.86.0 |
28 | | - components: rustfmt, clippy |
29 | | - override: true |
30 | | - |
31 | | - - name: Install sp1 toolchain |
32 | | - run: | |
33 | | - curl -L https://sp1.succinct.xyz | bash |
34 | | - source /home/runner/.bashrc |
35 | | - ~/.sp1/bin/sp1up |
36 | | -
|
37 | | - - name: Install risc0 toolchain |
38 | | - run: | |
39 | | - curl -L https://risczero.com/install | bash |
40 | | - source ~/.bashrc |
41 | | - ~/.risc0/bin/rzup install |
42 | | -
|
43 | | - - name: Cache Rust dependencies |
44 | | - uses: actions/cache@v3 |
45 | | - with: |
46 | | - path: | |
47 | | - ~/.cargo/registry |
48 | | - ~/.cargo/git |
49 | | - key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} |
50 | | - restore-keys: | |
51 | | - ${{ runner.os }}-rust- |
52 | | -
|
53 | | - - name: Clean build dir |
54 | | - run: rm -rf crates/target |
55 | | - |
56 | | - - name: Check formatting |
57 | | - run: | |
58 | | - cd crates |
59 | | - cargo fmt --all -- --check |
60 | | -
|
61 | | - - name: Run Clippy |
62 | | - run: | |
63 | | - cd crates |
64 | | - cargo clippy --all -- -D warnings |
65 | | -
|
66 | | - - name: Build Batcher |
67 | | - run: | |
68 | | - cd crates |
69 | | - cargo build --all -vv |
70 | | -
|
71 | | - - name: Check formatting of AggregationMode |
72 | | - run: | |
73 | | - cd aggregation_mode |
74 | | - cargo fmt --all -- --check |
75 | | -
|
76 | | - - name: Build AggregationMode |
77 | | - run: | |
78 | | - cd aggregation_mode |
79 | | - cargo build --all -vv |
80 | | -
|
81 | | - - name: Run Clippy on AggregationMode |
82 | | - run: | |
83 | | - cd aggregation_mode |
84 | | - RISC0_SKIP_BUILD=1 cargo clippy --all -- -D warnings |
85 | 16 |
|
86 | 17 | test: |
87 | 18 | runs-on: aligned-runner |
88 | 19 | needs: build |
89 | | - env: |
90 | | - CARGO_INCREMENTAL: 0 |
91 | | - |
92 | 20 | steps: |
93 | | - - uses: actions/checkout@v4 |
| 21 | + - name: Checkout code |
| 22 | + uses: actions/checkout@v4 |
94 | 23 |
|
95 | 24 | - name: foundry-toolchain |
96 | 25 | uses: foundry-rs/[email protected] |
97 | 26 |
|
98 | | - - name: Install sp1 toolchain |
99 | | - run: | |
100 | | - curl -L https://sp1.succinct.xyz | bash |
101 | | - source /home/runner/.bashrc |
102 | | - ~/.sp1/bin/sp1up |
103 | | -
|
104 | | - - name: Install risc0 toolchain |
105 | | - run: | |
106 | | - curl -L https://risczero.com/install | bash |
107 | | - source ~/.bashrc |
108 | | - ~/.risc0/bin/rzup install |
109 | | -
|
110 | 27 | - name: Cache Rust dependencies |
111 | 28 | uses: actions/cache@v3 |
112 | 29 | with: |
113 | 30 | path: | |
114 | 31 | ~/.cargo/registry |
115 | 32 | ~/.cargo/git |
| 33 | + crates/target |
116 | 34 | key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} |
117 | 35 | restore-keys: | |
118 | 36 | ${{ runner.os }}-rust- |
119 | 37 |
|
120 | | - - name: Clean build dir |
121 | | - run: rm -rf crates/target |
| 38 | + - name: Debug — dump expanded lib with #[cfg(test)] |
| 39 | + working-directory: crates |
| 40 | + env: |
| 41 | + RUSTFLAGS: --cfg test |
| 42 | + run: | |
| 43 | + cargo rustc -p aligned-batcher --lib -- -Zunstable-options --pretty=expanded > expanded.rs |
| 44 | + echo "=== searching for try_build_batch in expanded.rs ===" |
| 45 | + rg -n 'fn\s+try_build_batch' expanded.rs || true |
| 46 | + rg -n '__exposed_try_build_batch_for_tests' expanded.rs || true |
122 | 47 |
|
123 | 48 | - name: Run Batcher tests |
124 | 49 | run: | |
125 | 50 | cd crates |
126 | | - cargo test --all -vv |
| 51 | + cargo test --all |
127 | 52 |
|
128 | 53 | - name: Run AggregationMode tests |
129 | 54 | run: | |
130 | 55 | cd aggregation_mode |
131 | | - cargo test --all -vv |
| 56 | + cargo test --all |
0 commit comments