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

CI for v2-master #1673

Merged
merged 3 commits into from
Feb 5, 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
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's theoretically a breaking change, but 1.33 if pretty old and it's unlikely that many people still use it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not actually a breaking change since we hadn't released the 1.33 version bump. Also, in README, we say that Clap supports stable minus 2 versions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a breaking change. Though note we won't be releasing a new 2.0 version unless it's an emergency


<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