From 49aaa5ab0bb450c8c09e0d71e5e1c2f277cd5a19 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Sat, 9 Oct 2021 19:50:16 +0100 Subject: [PATCH] chore: CI improvements --- .github/workflows/ci-pr.yml | 2 +- .github/workflows/ci.yml | 8 ++++---- .github/workflows/coverage.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- CONTRIBUTING.md | 8 ++++---- README.md | 5 ++++- justfile | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index e63e1e3f..ce33d0c6 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -80,7 +80,7 @@ jobs: - name: Default features run: cargo check --all-targets - name: All features + Debug - run: cargo check --all-targets --features "wrap_help yaml regex debug" + run: cargo check --all-targets --features "wrap_help yaml regex unstable-replace debug" - name: No features run: cargo check --all-targets --no-default-features --features "std cargo" - name: UI Tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6625bc7..08b8df7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: push: - branches: [master, staging, trying] + branches: [staging, trying] jobs: ci: name: CI @@ -109,7 +109,7 @@ jobs: if: matrix.features == 'release' with: command: test - args: --target ${{ matrix.target }} --features "wrap_help yaml regex" --release + args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable-replace" --release nightly: name: Nightly Tests strategy: @@ -151,7 +151,7 @@ jobs: if: matrix.features == 'release' with: command: test - args: --features "wrap_help yaml regex" --release + args: --features "wrap_help yaml regex unstable-replace" --release wasm: name: Wasm Check runs-on: ubuntu-latest @@ -172,4 +172,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --target ${{ matrix.target }} --features "yaml regex" + args: --target ${{ matrix.target }} --features "yaml regex unstable-replace" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0de31903..6f68c286 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -3,7 +3,7 @@ on: pull_request: branches: [master] push: - branches: [master, staging, trying] + branches: [master] concurrency: group: coverage-${{ github.ref }} cancel-in-progress: true @@ -31,7 +31,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: llvm-cov - args: --features "wrap_help yaml regex" --lcov --output-path lcov.info + args: --features "wrap_help yaml regex unstable-replace" --lcov --output-path lcov.info - name: Coveralls uses: coverallsapp/github-action@master with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3157afcc..6d8490d2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ on: pull_request: branches: [master] push: - branches: [master, staging, trying] + branches: [staging, trying] concurrency: group: lint-${{ github.ref }} cancel-in-progress: true @@ -32,7 +32,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --features "wrap_help yaml regex" -- -D warnings + args: --features "wrap_help yaml regex unstable-replace" -- -D warnings - name: Format check uses: actions-rs/cargo@v1 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2e7198b..6f56e42d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ 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 --features "wrap_help yaml regex" +$ cargo test --features "wrap_help yaml regex unstable-replace" ``` Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the prebuilt recipes. *Not* using `just` is perfectly fine as well, it simply bundles commands automatically. @@ -39,7 +39,7 @@ During the CI process `clap` runs against many different lints using [`clippy`]( In order to check the code for lints and to format it run either: ```sh -$ cargo clippy --features "wrap_help yaml regex" -- -D warnings +$ cargo clippy --features "wrap_help yaml regex unstable-replace" -- -D warnings $ cargo fmt -- --check # Or @@ -64,8 +64,8 @@ $ just debug ### Tests and Documentation 1. Create tests for your changes -2. **Ensure the tests are passing.** Run the tests (`cargo test --features "wrap_help yaml regex"`), alternatively `just run-tests` if you have `just` installed. -3. **Optional** Run the lints (`cargo build --features lints`) (requires a nightly compiler), alternatively `just lint` +2. **Ensure the tests are passing.** Run the tests as specified above. +3. **Ensure linting is passing** Run the lints as specified above. 4. Ensure your changes contain documentation if adding new APIs or features. ### Preparing the PR diff --git a/README.md b/README.md index c3647b31..4129ddca 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Crates.io](https://img.shields.io/crates/d/clap?style=flat-square)](https://crates.io/crates/clap) [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/master/LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/master/LICENSE-MIT) -[![Build Status](https://img.shields.io/github/workflow/status/clap-rs/clap/CI/master?style=flat-square)](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Amaster) +[![Build Status](https://img.shields.io/github/workflow/status/clap-rs/clap/CI/staging?style=flat-square)](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Astaging) [![Coverage Status](https://img.shields.io/coveralls/github/clap-rs/clap/master?style=flat-square)](https://coveralls.io/github/clap-rs/clap?branch=master) [![Contributors](https://img.shields.io/github/contributors/clap-rs/clap?style=flat-square)](https://github.com/clap-rs/clap/graphs/contributors) @@ -37,6 +37,7 @@ We are currently hard at work trying to release `3.0`. We have a `3.0.0-beta.4` 1. [Optional Dependencies / Features](#optional-dependencies--features) 1. [Features enabled by default](#features-enabled-by-default) 2. [Opt-in features](#opt-in-features) + 3. [Experimental features](#experimental-features) 2. [More Information](#more-information) 7. [Sponsors](#sponsors) 8. [Contributing](#contributing) @@ -505,6 +506,8 @@ features = ["std", "suggestions", "color"] #### Experimental features +These features are opt-in. But be wary that they can contain breaking changes between minor releases. + * **unstable-replace**: Enable [`App::replace`](https://github.com/clap-rs/clap/issues/2836) ### More Information diff --git a/justfile b/justfile index a7da142f..d58c5345 100644 --- a/justfile +++ b/justfile @@ -5,7 +5,7 @@ debug TESTG TEST="": cargo test --test {{TESTG}} --features debug -- {{TEST}} run-tests: - cargo test --features "wrap_help yaml regex" + cargo test --features "wrap_help yaml regex unstable-replace" @bench: cargo bench @@ -13,7 +13,7 @@ run-tests: @lint: rustup component add clippy rustup component add rustfmt - cargo clippy --features "wrap_help yaml regex" -- -D warnings + cargo clippy --features "wrap_help yaml regex unstable-replace" -- -D warnings cargo fmt -- --check clean: