File tree Expand file tree Collapse file tree 9 files changed +56
-45
lines changed
Expand file tree Collapse file tree 9 files changed +56
-45
lines changed Original file line number Diff line number Diff line change 3535 - 1.36.0
3636 - nightly
3737 os :
38- - ubuntu
39- - windows
40- runs-on : ${{ matrix.os }}-latest
38+ - ubuntu-latest
39+ - windows-latest
40+ runs-on : ${{ matrix.os }}
41+ steps :
42+ - uses : actions/checkout@master
43+ - name : Install Rust
44+ run : rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
45+ - name : Test
46+ run : ./ci/${{ matrix.crates }}.sh
47+
48+ # Check all feature combinations works properly.
49+ check-features :
50+ name : check-features
51+ env :
52+ RUST_VERSION : ${{ matrix.rust }}
53+ strategy :
54+ matrix :
55+ rust :
56+ - 1.36.0
57+ - nightly
58+ runs-on : ubuntu-latest
4159 steps :
4260 - uses : actions/checkout@master
4361 - name : Install Rust
4765 run : |
4866 rustup target add thumbv7m-none-eabi
4967 rustup target add thumbv6m-none-eabi
50- - name : Test
51- run : ./ci/${{ matrix.crates }} .sh
68+ - name : Check features
69+ run : . . /ci/check-features .sh
5270
5371 # Check for duplicate dependencies.
5472 dependencies :
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -ex
4+
5+ if [[ ! -x " $( command -v cargo-hack) " ]]; then
6+ cargo install --debug cargo-hack || exit 1
7+ fi
8+
9+ if [[ " $RUST_VERSION " != " nightly" * ]]; then
10+ # On MSRV, features other than nightly should work.
11+ # * `--feature-powerset` - run for the feature powerset which includes --no-default-features and default features of package
12+ # * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
13+ # * `--exclude benchmarks` - benchmarks doesn't published.
14+ # * `--skip nightly` - skip `nightly` feature as requires nightly compilers.
15+ cargo hack check --all --feature-powerset --no-dev-deps --exclude benchmarks --skip nightly
16+ else
17+ # On nightly, all feature combinations should work.
18+ cargo hack check --all --feature-powerset --no-dev-deps --exclude benchmarks
19+ # TODO(taiki-e): if https://github.com/taiki-e/cargo-hack/issues/42 merged, remove this.
20+ cargo hack check --all --all-features --no-dev-deps --exclude benchmarks
21+
22+ # Check for no_std environment.
23+ cargo hack check --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv7m-none-eabi --skip std,default
24+ # * `--features nightly` is required for enable `cfg_target_has_atomic`.
25+ # * `--ignore-unknown-features` - some crates doesn't have 'nightly' feature
26+ cargo hack check --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv6m-none-eabi --skip std,default --features nightly --ignore-unknown-features
27+ fi
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export RUSTFLAGS="-D warnings"
88cargo check --bins --examples --tests
99cargo test -- --test-threads=1
1010
11- if [[ " $RUST_VERSION " == " nightly" ]]; then
11+ if [[ " $RUST_VERSION " == " nightly" * ]]; then
1212 cd benchmarks
1313 cargo check --bins
1414fi
Original file line number Diff line number Diff line change @@ -5,12 +5,10 @@ set -ex
55
66export RUSTFLAGS=" -D warnings"
77
8- cargo check --no-default-features
98cargo check --bins --examples --tests
109cargo test
1110
12- if [[ " $RUST_VERSION " == " nightly" ]]; then
13- cargo check --no-default-features --features nightly
11+ if [[ " $RUST_VERSION " == " nightly" * ]]; then
1412 cargo test --features nightly
1513
1614 if [[ " $OSTYPE " == " linux" * ]]; then
@@ -22,11 +20,4 @@ if [[ "$RUST_VERSION" == "nightly" ]]; then
2220 --features sanitize,nightly \
2321 --example sanitize
2422 fi
25-
26- # Check for no_std environment.
27- cargo check --target thumbv7m-none-eabi --no-default-features
28- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
29- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
30- cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
31- cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
3223fi
Original file line number Diff line number Diff line change 55
66export RUSTFLAGS=" -D warnings"
77
8- cargo check --no-default-features
98cargo check --bins --examples --tests
109cargo test
Original file line number Diff line number Diff line change 55
66export RUSTFLAGS=" -D warnings"
77
8- cargo check --no-default-features
98cargo check --bins --examples --tests
109cargo test
1110
12- if [[ " $RUST_VERSION " == " nightly" ]]; then
13- cargo check --no-default-features --features nightly
11+ if [[ " $RUST_VERSION " == " nightly" * ]]; then
1412 cargo test --features nightly
15-
16- # Check for no_std environment.
17- cargo check --target thumbv7m-none-eabi --no-default-features
18- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
19- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
20- cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
21- cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2213fi
Original file line number Diff line number Diff line change 55
66export RUSTFLAGS=" -D warnings"
77
8- cargo check --no-default-features
98cargo check --bins --examples --tests
109cargo test
1110
12- if [[ " $RUST_VERSION " == " nightly" ]]; then
13- cargo check --no-default-features --features nightly
11+ if [[ " $RUST_VERSION " == " nightly" * ]]; then
1412 cargo test --features nightly
15-
16- # Check for no_std environment.
17- cargo check --target thumbv7m-none-eabi --no-default-features
18- cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
1913fi
Original file line number Diff line number Diff line change 55
66export RUSTFLAGS=" -D warnings"
77
8- cargo check --no-default-features
98cargo check --bins --examples --tests
109cargo test
1110
12- if [[ " $RUST_VERSION " == " nightly" ]]; then
13- cargo check --no-default-features --features nightly
11+ if [[ " $RUST_VERSION " == " nightly" * ]]; then
1412 cargo test --features nightly
15-
16- # Check for no_std environment.
17- cargo check --target thumbv7m-none-eabi --no-default-features
18- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
19- cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
20- cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
21- cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2213fi
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ alloc = []
3131# This is disabled by default and requires recent nightly compiler.
3232# Note that this is outside of the normal semver guarantees and minor versions
3333# of crossbeam may make breaking changes to them at any time.
34- nightly = []
34+ nightly = [" crossbeam-utils/nightly " ]
3535
3636[dependencies ]
3737cfg-if = " 0.1.10"
You can’t perform that action at this time.
0 commit comments