ci: use -Z avoid-dev-deps in features check instead of --no-dev-deps (#1812)

This commit is contained in:
Taiki Endo 2019-11-23 07:13:18 +09:00 committed by Carl Lerche
parent bf741fec35
commit 7cd63fb946
4 changed files with 43 additions and 26 deletions

View File

@ -3,6 +3,7 @@ pr: ["master"]
variables:
RUSTFLAGS: -Dwarnings
nightly: nightly-2019-11-16
jobs:
# Test top level crate
@ -43,6 +44,12 @@ jobs:
name: cross
rust: stable
# Check each feature works properly
- template: ci/azure-check-features.yml
parameters:
rust: $(nightly)
name: check_features
# This represents the minimum Rust version supported by
# Tokio. Updating this should be done in a dedicated PR and
# cannot be greater than two 0.x releases prior to the
@ -53,7 +60,7 @@ jobs:
- template: ci/azure-check-minrust.yml
parameters:
name: minrust
rust_version: 1.39.0
rust: 1.39.0
# Check formatting
- template: ci/azure-rustfmt.yml
@ -70,7 +77,7 @@ jobs:
# Check doc generation
- template: ci/azure-check-docs.yml
parameters:
rust: nightly-2019-11-16
rust: $(nightly)
name: docs
# - template: ci/azure-tsan.yml
@ -89,4 +96,5 @@ jobs:
- loom
- cross
- minrust
- check_features
# - tsan

View File

@ -0,0 +1,32 @@
jobs:
- job: ${{ parameters.name }}
displayName: Check features
strategy:
matrix:
Linux:
vmImage: ubuntu-16.04
MacOS:
vmImage: macOS-10.13
Windows:
vmImage: vs2017-win2016
pool:
vmImage: $(vmImage)
steps:
- template: azure-install-rust.yml
parameters:
rust_version: ${{ parameters.rust }}
- template: azure-patch-crates.yml
- script: cargo install cargo-hack
displayName: Install cargo-hack
# Check each feature works properly
# * --each-feature
# run for each feature which includes --no-default-features and default features of package
# * -Z avoid-dev-deps
# build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
# tracking-issue: https://github.com/rust-lang/cargo/issues/5133
- script: cargo hack check --all --each-feature -Z avoid-dev-deps
displayName: cargo hack check --all --each-feature

View File

@ -6,7 +6,7 @@ jobs:
steps:
- template: azure-install-rust.yml
parameters:
rust_version: ${{ parameters.rust_version }}
rust_version: ${{ parameters.rust }}
- template: azure-patch-crates.yml

View File

@ -19,9 +19,6 @@ jobs:
parameters:
rust_version: ${{ parameters.rust }}
- script: cargo install cargo-hack
displayName: Install cargo-hack
- template: azure-is-release.yml
- ${{ each crate in parameters.crates }}:
@ -41,16 +38,6 @@ jobs:
displayName: ${{ crate }} - cargo test --all-features
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo hack check --each-feature
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
- template: azure-patch-crates.yml
- ${{ each crate in parameters.crates }}:
@ -69,13 +56,3 @@ jobs:
CI: 'True'
displayName: ${{ crate }} - cargo test --all-features
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}
# Check each specified feature works properly
# * --each-feature - run for each feature which includes --no-default-features and default features of package
# * --no-dev-deps - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- script: cargo hack check --each-feature --no-dev-deps
env:
LOOM_MAX_PREEMPTIONS: 2
CI: 'True'
displayName: ${{ crate }} - cargo hack check --each-feature
workingDirectory: $(Build.SourcesDirectory)/${{ crate }}