Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing coverage test #1747

Merged
merged 5 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ stages:
rust: 1.40.0
strategy:
matrix:
Windows 32-bit (MSVC):
MSVC 32-bit:
image: vs2017-win2016
target: i686-pc-windows-msvc
Windows 64-bit (MSVC):
MSVC 64-bit:
image: vs2017-win2016
target: x86_64-pc-windows-msvc
Windows 32-bit (MinGW):
MinGW 32-bit:
image: vs2017-win2016
target: i686-pc-windows-gnu
Windows 64-bit (MinGW):
MinGW 64-bit:
image: vs2017-win2016
target: x86_64-pc-windows-gnu
pool:
Expand All @@ -40,27 +40,12 @@ stages:
inputs:
key: cargo | "$(rust)" | $(target) | Cargo.toml
path: C:\Rust\.cargo
displayName: Caching cargo
- task: Cache@2
inputs:
key: compiled | "$(rust)" | $(target) | Cargo.toml
path: target
displayName: Caching compiled
displayName: Cache cargo
- script: rustup default $(rust)-$(target)
displayName: Install rust
- script: cargo test --no-default-features
displayName: Test without default features
env:
RUST_BACKTRACE: full
- script: cargo test --features "yaml unstable"
displayName: Test with most features
env:
RUST_BACKTRACE: full
- script: |
rmdir /Q /S C:\Rust\.cargo\registry\src
rmdir /Q /S target\.rustc_info.json
rmdir /Q /S target\debug\examples
rmdir /Q /S target\debug\incremental
rmdir /Q /S target\tests\target\debug\incremental
displayName: Cleaning for cache
displayName: Cleanup cache
continueOnError: true
55 changes: 28 additions & 27 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
name: Benchmark
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
Benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Checkout base
uses: actions/checkout@v2
- name: Update rust
run: rustup toolchain update stable
- name: Run benchmarks
run: cargo bench -- -R bencher | tee output.txt
- name: Download base benchmark
with:
ref: master
- name: Cache cargo
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
${{ runner.os }}-benchmark-${{ github.ref }}
${{ runner.os }}-benchmark
- name: Compare benchmarks for Pull Requests
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'pull_request'
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Bench base
run: cargo bench -- -R bencher | tee output.txt
- name: Save base benchmark
uses: pksunkara/github-action-benchmark@v1
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ github.token }}
comment-always: true
save-data-file: false
- name: Compare benchmarks for master branch
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'push'
external-data-json-path: ./benchmark-data.json
read-commit-id: true
- name: Checkout pull request
uses: actions/checkout@v2
with:
clean: false
- name: Bench pull request
run: cargo bench -- -R bencher | tee output.txt
- name: Compare benchmarks
uses: pksunkara/github-action-benchmark@v1
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
external-data-json-path: ./benchmark-data.json
github-token: ${{ github.token }}
alert-threshold: 125%
comment-on-alert: true
comment-always: true
- name: Cleanup cache
run: rm -rf ~/.cargo/registry/src
30 changes: 30 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linux
on:
push:
branches: [master, staging, trying]
pull_request:
branches: [master, staging, trying]
types: [opened, reopened, synchronize]
jobs:
test-release:
name: Release Profile Tests
runs-on: ubuntu-latest
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v2
- name: Cache cargo
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --release --features "yaml unstable"
- name: Cleanup cache
run: rm -rf ~/.cargo/registry/src
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ branches:
jobs:
allow_failures:
- rust: nightly
- name: Coverage
fast_finish: true
include:
- os: osx
Expand All @@ -36,9 +35,6 @@ jobs:
- rust: beta
- rust: nightly
cache: false
- name: Release profile tests
script:
- cargo test -v --release --features yaml unstable
- name: Linting (fmt + clippy)
before_script:
- rustup component add clippy
Expand All @@ -58,12 +54,11 @@ jobs:
- zlib1g-dev
update: true
before_script:
- cargo install cargo-tarpaulin
- cargo install cargo-tarpaulin --git git://github.com/pksunkara/tarpaulin --branch develop
script:
- cargo tarpaulin --workspace --features "yaml unstable" --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
script:
- cargo test --no-default-features
- cargo test --features yaml unstable
- cargo test --features "yaml unstable"
notifications:
email: false
env:
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Another really great way to help is if you find an interesting, or helpful way i
To test with all features both enabled and disabled, you can run these commands:

```sh
$ cargo test --no-default-features
$ cargo test --features "yaml unstable"
```

Expand Down
10 changes: 2 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,12 @@ wrap_help = ["term_size", "textwrap/term_size"]
derive = ["clap_derive", "lazy_static"]
yaml = ["yaml-rust"]
cargo = [] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
unstable = [] # for building with unstable clap features (doesn't require nightly Rust) (currently none)
nightly = [] # for building with unstable Rust features (currently none)
debug = [] # Enables debug messages
unstable = ["clap_derive/unstable"] # for building with unstable clap features (doesn't require nightly Rust) (currently none)
debug = ["clap_derive/debug"] # Enables debug messages
doc = ["yaml"] # All the features which add to documentation

[profile.dev]
codegen-units = 4

[profile.test]
opt-level = 1
debug = true
codegen-units = 4

[profile.bench]
lto = true
Expand Down
2 changes: 2 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
status = [
"continuous-integration/travis-ci/push",
"clap-rs.clap",
"Release Profile Tests",
]
pr_status = [
"continuous-integration/travis-ci/pr",
"clap-rs.clap",
"Release Profile Tests",
]
timeout_sec = 7200
prerun_timeout_sec = 7200
Expand Down
2 changes: 1 addition & 1 deletion clap_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ version-sync = "0.8"
[features]
default = []
unstable = []
nightly = []
debug = []
doc = []

[package.metadata.docs.rs]
features = ["doc"]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion clap_generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ version-sync = "0.8"
[features]
default = []
unstable = ["clap/unstable"]
nightly = ["clap/nightly"]
debug = ["clap/debug"]
doc = []

[package.metadata.docs.rs]
features = ["doc"]
targets = ["x86_64-unknown-linux-gnu"]