Skip to content
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

Build more in CI #51

Merged
merged 2 commits into from
Oct 29, 2023
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
21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ jobs:
- run: cargo +nightly run -p no-std-examples --example no-std-${{matrix.example}}

fuzz:
needs: each_package
needs: [test, each_package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo run --release -p tests --bin fuzz
- run: cargo run --release -p tests --bin fuzz -- --random
- run: cargo run --release -p tests --features test --bin fuzz
- run: cargo run --release -p tests --features test --bin fuzz -- --random

miri:
needs: test
needs: [test, each_package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- run: cargo miri test --workspace --exclude no-std-examples --exclude musli-common --features test
- run: cargo miri run -p tests --bin fuzz
- run: cargo miri run -p tests --bin fuzz -- --random
- run: cargo miri run -p tests --features test --bin fuzz
- run: cargo miri run -p tests --features test --bin fuzz -- --random

each_package:
needs: [rustfmt, clippy]
Expand Down Expand Up @@ -89,6 +89,15 @@ jobs:
components: clippy
- run: cargo clippy --all-targets --features test -- -D warnings

clippy_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.73
with:
components: clippy
- run: cargo run -p tools -- clippy -- -D warnings

rustfmt:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ publish = false

[features]
default = ["std"]
extra = ["rkyv", "dlhn", "bitcode", "serde_cbor"]
full = ["rmp-serde", "bincode", "postcard", "musli-json", "serde_json"]
extra = ["rkyv", "dlhn", "serde_cbor"]
full = ["rmp-serde", "bincode", "postcard", "musli-json", "serde_json", "bitcode"]
text = ["musli-json", "serde_json"]
std = ["alloc", "musli?/std", "musli-wire?/std", "musli-storage?/std", "musli-json?/std", "musli-zerocopy?/std", "rand/std", "serde_json?/std", "rkyv?/std", "serde?/std"]
alloc = ["musli?/alloc", "musli-wire?/alloc", "musli-storage?/alloc", "musli-json?/alloc", "musli-zerocopy?/alloc"]
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/src/aligned_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl AlignedBuf {
}

#[inline]
pub unsafe fn store_bytes<T>(&mut self, values: &[T]) {
pub(crate) unsafe fn store_bytes<T>(&mut self, values: &[T]) {
let dst = self.data.as_ptr().wrapping_add(self.len);
dst.copy_from_nonoverlapping(values.as_ptr().cast(), size_of_val(values));
self.len += size_of_val(values);
Expand Down
12 changes: 6 additions & 6 deletions crates/tests/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ impl PartialEq<Tuples> for &Tuples {
#[cfg_attr(feature = "musli", musli(mode = Packed))]
pub enum MediumEnum {
#[cfg_attr(feature = "musli", musli(transparent))]
StringVariant(String),
String(String),
#[cfg_attr(feature = "musli", musli(transparent))]
NumberedVariant(u64),
EmptyTupleVariant(),
NamedEmptyVariant {},
NamedVariant {
Numbered(u64),
EmptyTuple(),
NamedEmpty {},
Named {
a: u32,
primitives: Primitives,
b: u64,
},
UnnamedVariant,
Unnamed,
}

#[cfg(feature = "rkyv")]
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/src/utils/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub mod zerocopy {
where
T: FromBytes,
{
T::read_from(&self.buffer[..]).ok_or(Error)
T::read_from(self.buffer).ok_or(Error)
}
}
}
4 changes: 2 additions & 2 deletions crates/tests/src/utils/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub mod postcard {

// Figure out the size of the buffer to use. Don't worry, anything we do
// in `reset` doesn't count towards benchmarking.
while let Err(error) = postcard::to_slice(value, &mut self.buffer) {
while let Err(error) = postcard::to_slice(value, self.buffer) {
match error {
postcard::Error::SerializeBufferFull => {
let new_size = (self.buffer.len() as f32 * 1.5f32) as usize;
Expand All @@ -140,7 +140,7 @@ pub mod postcard {
where
T: Serialize,
{
let buf = postcard::to_slice(value, &mut self.buffer)?;
let buf = postcard::to_slice(value, self.buffer)?;
Ok(buf)
}

Expand Down
1 change: 1 addition & 0 deletions crates/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ publish = false

[dependencies]
anyhow = "1.0.75"
clap = { version = "4.4.7", features = ["derive"] }
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
tests = { path = "../tests" }
Loading