diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6077b7..1a69295 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,6 @@ jobs: - beta - nightly - 1.51.0 - features: - - default - - no_defaults - - file_locks - include: - - rust: nightly - features: all steps: - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1.0.7 @@ -40,42 +33,36 @@ jobs: with: command: fmt args: -- --check - if: ${{ matrix.features == 'default' && matrix.rust == 'nightly' }} + if: ${{ matrix.rust == 'nightly' }} - name: Clippy uses: actions-rs/cargo@v1.0.3 env: RUSTFLAGS: -Dwarnings with: command: clippy - if: ${{ matrix.features == 'default' }} continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' }} - - name: Build and test feature ${{ matrix.features }} + - name: Install cargo-binstall + run: | + curl --location --remote-name https://github.com/ryankurte/cargo-binstall/releases/download/v0.11.1/cargo-binstall-x86_64-unknown-linux-musl.tgz + tar -zxvf cargo-binstall-x86_64-unknown-linux-musl.tgz + mv cargo-binstall ~/.cargo/bin + ls -l ~/.cargo/bin + - name: Install "build all features" uses: actions-rs/cargo@v1.0.3 with: - command: test - args: --features ${{ matrix.features }} -- --nocapture - env: - RUST_TEST_THREADS: 3 # So the parallel tests have enough threads - RUST_LOG: debug - if: ${{ matrix.features != 'all' && matrix.features != 'no_defaults' }} - - name: Build and test all features + command: binstall + args: cargo-all-features --no-confirm --version 1.7.0 + - name: Build all features uses: actions-rs/cargo@v1.0.3 with: - command: test - args: --all-features -- --nocapture - if: ${{ matrix.features == 'all' }} - env: - RUST_TEST_THREADS: 3 # So the parallel tests have enough threads - RUST_LOG: debug - - name: Build and test without default features + command: build-all-features + - name: Test all features uses: actions-rs/cargo@v1.0.3 with: - command: test - args: --no-default-features -- --nocapture - if: ${{ matrix.features == 'no_defaults' }} + command: test-all-features env: RUST_TEST_THREADS: 3 # So the parallel tests have enough threads - RUST_LOG: debug + RUST_LOG: debug multi-os-testing: name: Test suite diff --git a/serial_test/Cargo.toml b/serial_test/Cargo.toml index 23bd311..d2777e8 100644 --- a/serial_test/Cargo.toml +++ b/serial_test/Cargo.toml @@ -45,3 +45,7 @@ docsrs = ["document-features"] all-features = true # defines the configuration attribute `docsrs` rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.cargo-all-features] +skip_optional_dependencies = true +denylist = ["docsrs"] \ No newline at end of file diff --git a/serial_test/src/code_lock.rs b/serial_test/src/code_lock.rs index 48e2128..279b3fb 100644 --- a/serial_test/src/code_lock.rs +++ b/serial_test/src/code_lock.rs @@ -1,6 +1,6 @@ use crate::rwlock::{Locks, MutexGuardWrapper}; use lazy_static::lazy_static; -#[cfg(feature = "logging")] +#[cfg(all(feature = "logging", feature = "timeout"))] use log::debug; use parking_lot::RwLock; #[cfg(feature = "timeout")] diff --git a/serial_test/src/lib.rs b/serial_test/src/lib.rs index 28e9abc..838ca9b 100644 --- a/serial_test/src/lib.rs +++ b/serial_test/src/lib.rs @@ -1,6 +1,7 @@ #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![deny(unused_variables)] #![deny(missing_docs)] +#![deny(unused_imports)] //! # serial_test //! `serial_test` allows for the creation of serialised Rust tests using the [serial](macro@serial) attribute