diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6fb56a9b7..7c62f1b808 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,26 +80,21 @@ jobs: echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git >> $GITHUB_ENV - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - - name: Install cargo-rm - run: cargo install cargo-edit --version 0.11.0 - name: Use pinned Cargo.lock for Rust 1.34 and 1.44 if: ${{ matrix.rust-version == 1.34 || matrix.rust-version == 1.44 }} run: cp Cargo.lock.rust134 Cargo.lock - name: Build the library run: cargo build - # Remove criterion to support testing with earlier versions - - name: Remove criterion - run: cargo-rm rm --dev criterion - name: Test run: cargo test - name: Build all targets with all features # Some optional features are not compatible with earlier versions if: ${{ matrix.rust-version == 'stable' }} - run: cargo hack --feature-powerset build --workspace + run: cargo hack --feature-powerset build --workspace --all-targets - name: Test all targets with all features # Some optional features are not compatible with earlier versions if: ${{ matrix.rust-version == 'stable' }} - run: cargo hack --feature-powerset test --workspace + run: cargo hack --feature-powerset test --workspace --all-targets miri: name: Check unsafe code against miri diff --git a/Cargo.toml b/Cargo.toml index 9d7259da74..e2c1403045 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,10 +21,6 @@ authors = [ edition = "2018" exclude = [".cargo/**/*", ".github/**/*"] -[[bench]] -name = "bench" -harness = false - [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg=doc_cfg"] @@ -36,7 +32,6 @@ serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] bincode = "1" serde_bytes = "0.11.8" -criterion = "0.4" [features] serde1 = ["serde"] diff --git a/camino-examples/Cargo.toml b/camino-examples/Cargo.toml index 58b7845c3b..1c344102b9 100644 --- a/camino-examples/Cargo.toml +++ b/camino-examples/Cargo.toml @@ -12,5 +12,12 @@ clap = { version = "3.0.7", features = ["derive"] } serde = { version = "1", features = ["derive"] } serde_json = { version = "1.0.62" } +[dev-dependencies] +criterion = "0.5.1" + [[bin]] name = "serde" + +[[bench]] +name = "bench" +harness = false diff --git a/benches/bench.rs b/camino-examples/benches/bench.rs similarity index 68% rename from benches/bench.rs rename to camino-examples/benches/bench.rs index 1f1bf3b1e1..1c924f1b86 100644 --- a/benches/bench.rs +++ b/camino-examples/benches/bench.rs @@ -1,6 +1,11 @@ -use criterion::*; +// Copyright (c) The camino Contributors +// SPDX-License-Identifier: MIT OR Apache-2.0 + +// This benchmark is here because criterion has a higher MSRV than camino -- camino-examples is only +// tested on stable, which is good enough. use camino::Utf8PathBuf; +use criterion::*; fn bench_path(c: &mut Criterion) { let mut group = c.benchmark_group("Path");