Skip to content

Commit

Permalink
CI: more accurate no-default-feature and nightly test targets
Browse files Browse the repository at this point in the history
Also more accurate flags in examples
  • Loading branch information
dhardy committed Jan 25, 2021
1 parent 6a6b9fd commit 22dec87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ jobs:
- name: Maybe nightly
if: ${{ matrix.toolchain == 'nightly' }}
run: |
cargo test --target ${{ matrix.target }} --tests --features=nightly
cargo test --target ${{ matrix.target }} --features=nightly
cargo test --target ${{ matrix.target }} --all-features
cargo test --target ${{ matrix.target }} --benches --features=nightly
cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches
- name: Test rand
run: |
cargo test --target ${{ matrix.target }} --tests --no-default-features
cargo test --target ${{ matrix.target }} --tests --no-default-features --features=alloc,getrandom,small_rng
cargo test --target ${{ matrix.target }} --lib --tests --no-default-features
cargo build --target ${{ matrix.target }} --no-default-features --features alloc,getrandom,small_rng
cargo test --target ${{ matrix.target }} --lib --tests --no-default-features --features=alloc,getrandom,small_rng
# all stable features:
cargo test --target ${{ matrix.target }} --features=serde1,log,small_rng
cargo test --target ${{ matrix.target }} --examples
Expand Down
2 changes: 1 addition & 1 deletion examples/monte-carlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! the square at random, calculate the fraction that fall within the circle,
//! and multiply this fraction by 4.

#![cfg(feature = "std")]
#![cfg(all(feature = "std", feature = "std_rng"))]

use rand::distributions::{Distribution, Uniform};

Expand Down
2 changes: 1 addition & 1 deletion examples/monty-hall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//!
//! [Monty Hall Problem]: https://en.wikipedia.org/wiki/Monty_Hall_problem

#![cfg(feature = "std")]
#![cfg(all(feature = "std", feature = "std_rng"))]

use rand::distributions::{Distribution, Uniform};
use rand::Rng;
Expand Down

0 comments on commit 22dec87

Please sign in to comment.