Skip to content

Commit 8b1d18a

Browse files
committed
Force CI to clean itself
1 parent f9e5b94 commit 8b1d18a

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

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

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
jobs:
1616
build:
1717
runs-on: aligned-runner
18+
env:
19+
CARGO_INCREMENTAL: 0
1820

1921
steps:
2022
- uses: actions/checkout@v4
@@ -26,12 +28,11 @@ jobs:
2628
components: rustfmt, clippy
2729
override: true
2830

29-
# Reference: https://github.com/succinctlabs/sp1/actions/runs/8886659400/workflow#L61-L65
3031
- name: Install sp1 toolchain
3132
run: |
3233
curl -L https://sp1.succinct.xyz | bash
3334
source /home/runner/.bashrc
34-
~/.sp1/bin/sp1up
35+
~/.sp1/bin/sp1up
3536
3637
- name: Install risc0 toolchain
3738
run: |
@@ -45,11 +46,13 @@ jobs:
4546
path: |
4647
~/.cargo/registry
4748
~/.cargo/git
48-
crates/target
4949
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
5050
restore-keys: |
5151
${{ runner.os }}-rust-
5252
53+
- name: Clean build dir
54+
run: rm -rf crates/target
55+
5356
- name: Check formatting
5457
run: |
5558
cd crates
@@ -63,40 +66,40 @@ jobs:
6366
- name: Build Batcher
6467
run: |
6568
cd crates
66-
cargo build --all
69+
cargo build --all -vv
6770
6871
- name: Check formatting of AggregationMode
6972
run: |
7073
cd aggregation_mode
7174
cargo fmt --all -- --check
7275
73-
- name: Build AggregationMode # We build before clippy to generate the ELF
76+
- name: Build AggregationMode
7477
run: |
7578
cd aggregation_mode
76-
cargo build --all
79+
cargo build --all -vv
7780
7881
- name: Run Clippy on AggregationMode
7982
run: |
8083
cd aggregation_mode
81-
# We need to skip the build as clippy does not support the riscv32im-risc0-zkvm-elf target
8284
RISC0_SKIP_BUILD=1 cargo clippy --all -- -D warnings
8385
8486
test:
8587
runs-on: aligned-runner
8688
needs: build
89+
env:
90+
CARGO_INCREMENTAL: 0
91+
8792
steps:
88-
- name: Checkout code
89-
uses: actions/checkout@v4
93+
- uses: actions/checkout@v4
9094

9195
- name: foundry-toolchain
9296
uses: foundry-rs/[email protected]
9397

94-
# Reference: https://github.com/succinctlabs/sp1/actions/runs/8886659400/workflow#L61-L65
9598
- name: Install sp1 toolchain
9699
run: |
97100
curl -L https://sp1.succinct.xyz | bash
98101
source /home/runner/.bashrc
99-
~/.sp1/bin/sp1up
102+
~/.sp1/bin/sp1up
100103
101104
- name: Install risc0 toolchain
102105
run: |
@@ -110,17 +113,19 @@ jobs:
110113
path: |
111114
~/.cargo/registry
112115
~/.cargo/git
113-
crates/target
114116
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
115117
restore-keys: |
116118
${{ runner.os }}-rust-
117119
120+
- name: Clean build dir
121+
run: rm -rf crates/target
122+
118123
- name: Run Batcher tests
119124
run: |
120125
cd crates
121-
cargo test --all
126+
cargo test --all -vv
122127
123128
- name: Run AggregationMode tests
124129
run: |
125130
cd aggregation_mode
126-
cargo test --all
131+
cargo test --all -vv

crates/batcher/src/types/batch_queue.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ use std::{
1212
use super::errors::BatcherError;
1313
use crate::connection::WsMessageSink;
1414

15+
#[cfg(test)]
16+
const _TRY_BUILD_BATCH_VISIBLE_UNDER_TEST: fn() = try_build_batch;
17+
1518
#[derive(Clone)]
1619
pub(crate) struct BatchQueueEntry {
1720
pub(crate) nonced_verification_data: NoncedVerificationData,
@@ -201,13 +204,24 @@ fn calculate_fee_per_proof(batch_len: usize, gas_price: U256, constant_gas_cost:
201204

202205
#[cfg(test)]
203206
mod test {
207+
208+
#[test]
209+
fn print_parent_info() {
210+
// Should compile if test’s parent is the module that defines the function
211+
let _f: fn(_, _, _) = super::try_build_batch;
212+
213+
// Print the path rustc believes this module is
214+
eprintln!("module_path: {}", module_path!());
215+
eprintln!("file!: {}", file!());
216+
}
217+
204218
use aligned_sdk::common::constants::DEFAULT_CONSTANT_GAS_COST;
205219
use aligned_sdk::common::types::ProvingSystemId;
206220
use aligned_sdk::common::types::VerificationData;
207221
use ethers::types::Address;
208222

209223
use super::*;
210-
use crate::types::batch_queue::try_build_batch;
224+
use super::try_build_batch;
211225

212226
#[test]
213227
fn batch_finalization_algorithm_works_from_same_sender() {

0 commit comments

Comments
 (0)