Skip to content

Commit

Permalink
Merge pull request #1673 from clap-rs/v2-ci
Browse files Browse the repository at this point in the history
CI for v2-master
  • Loading branch information
pksunkara authored Feb 5, 2020
2 parents fa45af5 + 48a71f3 commit 0129fe5
Show file tree
Hide file tree
Showing 107 changed files with 6,134 additions and 4,336 deletions.
17 changes: 0 additions & 17 deletions .appveyor.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: $(Build.BuildId)
trigger:
# Always build master
- v2-master
pr:
# Enable building pull requests.
- v2-master
stages:
- stage: Testing
jobs:
- job:
variables:
rust: 1.36.0
strategy:
matrix:
Windows 32-bit (MSVC):
image: vs2017-win2016
target: i686-pc-windows-msvc
Windows 64-bit (MSVC):
image: vs2017-win2016
target: x86_64-pc-windows-msvc
Windows 32-bit (MinGW):
image: vs2017-win2016
target: i686-pc-windows-gnu
Windows 64-bit (MinGW):
image: vs2017-win2016
target: x86_64-pc-windows-gnu
pool:
vmImage: $(image)
steps:
- checkout: self
fetchDepth: 1
path: clap
displayName: Checkout repository
- task: Cache@2
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
- 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
displayName: Cleaning for cache
continueOnError: true
9 changes: 0 additions & 9 deletions .mention-bot

This file was deleted.

127 changes: 63 additions & 64 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,66 @@
sudo: true
os: linux
language: rust
cache:
directories:
- $HOME/.cargo
- $HOME/.rustup
cache: cargo
before_cache:
- rm -rf /home/travis/.cargo/registry
rust:
- nightly
- nightly-2019-06-18
- beta
- stable
- 1.33.0
matrix:
allow_failures:
- rust: nightly
nightly-2019-06-18:
- script: cargo clippy
before_script:
- |
pip install git+git://github.com/kbknapp/travis-cargo.git --user &&
export PATH=$HOME/.local/bin:$PATH
- |
if [[ "$TRAVIS_RUST_VERSION" == "1.13.0" ]]; then
echo "Old Rust detected, removing version-sync dependency"
sed -i "/^version-sync =/d" Cargo.toml
rm "tests/version-numbers.rs"
fi
- find target/debug -type f -maxdepth 1 -delete
- rm -rf target/.rustc_info.json
- rm -rf target/debug/examples
- rm -rf target/debug/incremental
- rm -rf target/tests/target/debug/incremental
- rm -rf target/tests/target/debug/deps/{clap*, trybuild*}
- rm -rf target/debug/{deps,.fingerpint}/clap*
- find target/debug/deps -name "clap*" -exec rm -rf {} +
- ls -1 examples/ | sed -e 's/\.rs$//' | xargs -I "{{}}" find target/debug/deps -name "{{}}*" -exec rm -rf {} +
- ls -1 tests/ | sed -e 's/\.rs$//' | xargs -I "{{}}" find target/debug/deps -name "{{}}*" -exec rm -rf {} +
rust: stable
branches:
only:
# Always build master & Enable building pull requests.
- v2-master
jobs:
allow_failures:
- rust: nightly
- env:
- SHARD=coverage
fast_finish: true
include:
- os: osx
rust: 1.36.0
- rust: 1.36.0
- {}
- rust: beta
- rust: nightly
- env:
- SHARD=lint
before_script:
- rustup component add clippy
- rustup component add rustfmt
script:
- echo "Checking codebase with Clippy release `cargo clippy --version`."
- cargo clippy --lib --features "yaml unstable"
- cargo clippy --tests --examples --features "yaml unstable"
- cargo fmt -- --check
- rust: nightly
env:
- SHARD=bench
script:
- cargo bench
- env:
- SHARD=coverage
addons:
apt:
packages:
- libssl-dev
- cmake
- pkg-config
- zlib1g-dev
update: true
before_script:
- cargo install cargo-tarpaulin
script:
- cargo tarpaulin --features "yaml unstable" --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
script:
- |
travis-cargo --only stable test -- --verbose --no-default-features &&
travis-cargo --skip nightly test -- --verbose --features "yaml unstable" &&
travis-cargo --only nightly test -- --verbose --features "yaml unstable nightly" &&
travis-cargo --only nightly bench -- --no-run
addons:
apt:
packages:
- binutils-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- libiberty-dev
- cmake
- gcc
- zlib1g-dev
after_success:
- |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
cargo clean &&
cargo test --no-run --features "yaml unstable" &&
for file in target/debug/*-*; do mkdir -p "target/cov/$(basename $file)"; kcov --exclude-pattern=/.cargo --verify "target/cov/$(basename $file)" "$file"; done &&
kcov --coveralls-id=$TRAVIS_JOB_ID --merge target/cov target/cov/* &&
echo "Uploaded code coverage"
env:
global:
- TRAVIS_CARGO_NIGHTLY_FEATURE=lints
- secure: JLBlgHY6OEmhJ8woewNJHmuBokTNUv7/WvLkJGV8xk0t6bXBwSU0jNloXwlH7FiQTc4TccX0PumPDD4MrMgxIAVFPmmmlQOCmdpYP4tqZJ8xo189E5zk8lKF5OyaVYCs5SMmFC3cxCsKjfwGIexNu3ck5Uhwe9jI0tqgkgM3URA=
- cargo test --no-default-features
- cargo test --features yaml unstable
notifications:
email: false
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Minimum Required Rust

* As of this release, `clap` requires `rustc 1.33.0` or greater.
* As of this release, `clap` requires `rustc 1.36.0` or greater.

<a name="v2.33.0"></a>
## v2.33.0 (2019-04-06)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ This is inherently an unresolvable crate graph in Cargo right now. Cargo require

#### Minimum Version of Rust

`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.35.0, meaning `clap` is guaranteed to compile with 1.33.0 and beyond.
`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.41.0, meaning `clap` is guaranteed to compile with 1.39.0 and beyond.

At the 1.36.0 stable release, `clap` will be guaranteed to compile with 1.34.0 and beyond, etc.
At the 1.42.0 stable release, `clap` will be guaranteed to compile with 1.40.0 and beyond, etc.

Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be clearly annotated in the `CHANGELOG.md`

Expand Down
17 changes: 9 additions & 8 deletions benches/02_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ use clap::{App, Arg};
use test::Bencher;

macro_rules! create_app {
() => ({
() => {{
App::new("claptests")
.version("0.1")
.about("tests clap library")
.author("Kevin K. <[email protected]>")
.args_from_usage("-f --flag 'tests flags'
.version("0.1")
.about("tests clap library")
.author("Kevin K. <[email protected]>")
.args_from_usage(
"-f --flag 'tests flags'
-o --option=[opt] 'tests options'
[positional] 'tests positional'")
})
[positional] 'tests positional'",
)
}};
}

#[bench]
fn build_app(b: &mut Bencher) {

b.iter(|| create_app!());
}

Expand Down
Loading

0 comments on commit 0129fe5

Please sign in to comment.