Skip to content

Use hosted runners #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,56 @@ env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
# Faster crates.io index checkout.
# Enable once the MSRV is >= 1.68
#CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
RUST_LOG: debug

jobs:
check_clippy:
# runs-on: ubuntu-24.04
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Clippy
steps:
- uses: actions/checkout@v4
- name: Run cargo clippy
run: cargo clippy --workspace --all-features -- -D warnings
run: |
rustup component add clippy
cargo clippy --workspace --all-features -- -D warnings

check_fmt:
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Checking fmt
steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check
run: |
rustup component add rustfmt
cargo fmt --all -- --check

rustdoc:
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Rustdoc
steps:
- uses: actions/checkout@v4
- name: Run rustdoc
run: cargo rustdoc --all-features -- -D warnings

build:
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Release build
steps:
- uses: actions/checkout@v4
- name: Run cargo release build
run: cargo build --release

benches:
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Run benchmarks
steps:
- uses: actions/checkout@v4
- name: Run benchmarks
run: cargo bench --all-targets

test:
runs-on: self-hosted
runs-on: ubuntu-24.04
name: Run cargo test
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.66.1
1.71.1
2 changes: 1 addition & 1 deletion src/hash_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<H: Hasher, const N: usize> Hashable<H> for [u8; N] {

#[allow(trivial_casts, unsafe_code)]
fn hash_slice(data: &[[u8; N]], state: &mut H) {
let newlen = data.len() * mem::size_of::<[u8; N]>();
let newlen = mem::size_of_val(data);
let ptr = data.as_ptr() as *const u8;
state.write(unsafe { slice::from_raw_parts(ptr, newlen) })
}
Expand Down
7 changes: 3 additions & 4 deletions src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ impl<

let mut data = S::new(size).expect("failed to create data store");

populate_data_par::<E, A, S, BaseTreeArity, _>(&mut data, iter)?;
populate_data_par::<E, A, S, _>(&mut data, iter)?;
let root = S::build::<A, BaseTreeArity>(&mut data, leafs, row_count, None)?;

Ok(MerkleTree {
Expand Down Expand Up @@ -1689,7 +1689,7 @@ impl<
});
}

populate_data_par::<E, A, S, BaseTreeArity, _>(&mut data, iter)?;
populate_data_par::<E, A, S, _>(&mut data, iter)?;
let root = S::build::<A, BaseTreeArity>(&mut data, leafs, row_count, Some(config))?;

Ok(MerkleTree {
Expand Down Expand Up @@ -2049,12 +2049,11 @@ pub fn populate_data<
Ok(())
}

fn populate_data_par<E, A, S, BaseTreeArity, I>(data: &mut S, iter: I) -> Result<()>
fn populate_data_par<E, A, S, I>(data: &mut S, iter: I) -> Result<()>
where
E: Element,
A: Algorithm<E>,
S: Store<E>,
BaseTreeArity: Unsigned,
I: ParallelIterator<Item = E> + IndexedParallelIterator,
{
if !data.is_empty() {
Expand Down