mirror of
https://github.com/clap-rs/clap
synced 2025-01-18 23:53:54 +00:00
Merge #2841
2841: chore: CI improvements r=epage a=pksunkara Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This commit is contained in:
commit
8552312fcb
7 changed files with 19 additions and 16 deletions
2
.github/workflows/ci-pr.yml
vendored
2
.github/workflows/ci-pr.yml
vendored
|
@ -80,7 +80,7 @@ jobs:
|
||||||
- name: Default features
|
- name: Default features
|
||||||
run: cargo check --all-targets
|
run: cargo check --all-targets
|
||||||
- name: All features + Debug
|
- 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
|
- name: No features
|
||||||
run: cargo check --all-targets --no-default-features --features "std cargo"
|
run: cargo check --all-targets --no-default-features --features "std cargo"
|
||||||
- name: UI Tests
|
- name: UI Tests
|
||||||
|
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -1,7 +1,7 @@
|
||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master, staging, trying]
|
branches: [staging, trying]
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
name: CI
|
name: CI
|
||||||
|
@ -109,7 +109,7 @@ jobs:
|
||||||
if: matrix.features == 'release'
|
if: matrix.features == 'release'
|
||||||
with:
|
with:
|
||||||
command: test
|
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:
|
nightly:
|
||||||
name: Nightly Tests
|
name: Nightly Tests
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -151,7 +151,7 @@ jobs:
|
||||||
if: matrix.features == 'release'
|
if: matrix.features == 'release'
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --features "wrap_help yaml regex" --release
|
args: --features "wrap_help yaml regex unstable-replace" --release
|
||||||
wasm:
|
wasm:
|
||||||
name: Wasm Check
|
name: Wasm Check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -172,4 +172,4 @@ jobs:
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: check
|
command: check
|
||||||
args: --target ${{ matrix.target }} --features "yaml regex"
|
args: --target ${{ matrix.target }} --features "yaml regex unstable-replace"
|
||||||
|
|
4
.github/workflows/coverage.yml
vendored
4
.github/workflows/coverage.yml
vendored
|
@ -3,7 +3,7 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
push:
|
push:
|
||||||
branches: [master, staging, trying]
|
branches: [master]
|
||||||
concurrency:
|
concurrency:
|
||||||
group: coverage-${{ github.ref }}
|
group: coverage-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
@ -31,7 +31,7 @@ jobs:
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: llvm-cov
|
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
|
- name: Coveralls
|
||||||
uses: coverallsapp/github-action@master
|
uses: coverallsapp/github-action@master
|
||||||
with:
|
with:
|
||||||
|
|
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
|
@ -3,7 +3,7 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
push:
|
push:
|
||||||
branches: [master, staging, trying]
|
branches: [staging, trying]
|
||||||
concurrency:
|
concurrency:
|
||||||
group: lint-${{ github.ref }}
|
group: lint-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
@ -32,7 +32,7 @@ jobs:
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: clippy
|
command: clippy
|
||||||
args: --features "wrap_help yaml regex" -- -D warnings
|
args: --features "wrap_help yaml regex unstable-replace" -- -D warnings
|
||||||
- name: Format check
|
- name: Format check
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -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:
|
To test with all features both enabled and disabled, you can run these commands:
|
||||||
|
|
||||||
```sh
|
```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.
|
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:
|
In order to check the code for lints and to format it run either:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cargo clippy --features "wrap_help yaml regex" -- -D warnings
|
$ cargo clippy --features "wrap_help yaml regex unstable-replace" -- -D warnings
|
||||||
$ cargo fmt -- --check
|
$ cargo fmt -- --check
|
||||||
|
|
||||||
# Or
|
# Or
|
||||||
|
@ -64,8 +64,8 @@ $ just debug <test_name>
|
||||||
### Tests and Documentation
|
### Tests and Documentation
|
||||||
|
|
||||||
1. Create tests for your changes
|
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.
|
2. **Ensure the tests are passing.** Run the tests as specified above.
|
||||||
3. **Optional** Run the lints (`cargo build --features lints`) (requires a nightly compiler), alternatively `just lint`
|
3. **Ensure linting is passing** Run the lints as specified above.
|
||||||
4. Ensure your changes contain documentation if adding new APIs or features.
|
4. Ensure your changes contain documentation if adding new APIs or features.
|
||||||
|
|
||||||
### Preparing the PR
|
### Preparing the PR
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
[![Crates.io](https://img.shields.io/crates/d/clap?style=flat-square)](https://crates.io/crates/clap)
|
[![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-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)
|
[![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)
|
[![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)
|
[![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. [Optional Dependencies / Features](#optional-dependencies--features)
|
||||||
1. [Features enabled by default](#features-enabled-by-default)
|
1. [Features enabled by default](#features-enabled-by-default)
|
||||||
2. [Opt-in features](#opt-in-features)
|
2. [Opt-in features](#opt-in-features)
|
||||||
|
3. [Experimental features](#experimental-features)
|
||||||
2. [More Information](#more-information)
|
2. [More Information](#more-information)
|
||||||
7. [Sponsors](#sponsors)
|
7. [Sponsors](#sponsors)
|
||||||
8. [Contributing](#contributing)
|
8. [Contributing](#contributing)
|
||||||
|
@ -505,6 +506,8 @@ features = ["std", "suggestions", "color"]
|
||||||
|
|
||||||
#### Experimental features
|
#### 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)
|
* **unstable-replace**: Enable [`App::replace`](https://github.com/clap-rs/clap/issues/2836)
|
||||||
|
|
||||||
### More Information
|
### More Information
|
||||||
|
|
4
justfile
4
justfile
|
@ -5,7 +5,7 @@ debug TESTG TEST="":
|
||||||
cargo test --test {{TESTG}} --features debug -- {{TEST}}
|
cargo test --test {{TESTG}} --features debug -- {{TEST}}
|
||||||
|
|
||||||
run-tests:
|
run-tests:
|
||||||
cargo test --features "wrap_help yaml regex"
|
cargo test --features "wrap_help yaml regex unstable-replace"
|
||||||
|
|
||||||
@bench:
|
@bench:
|
||||||
cargo bench
|
cargo bench
|
||||||
|
@ -13,7 +13,7 @@ run-tests:
|
||||||
@lint:
|
@lint:
|
||||||
rustup component add clippy
|
rustup component add clippy
|
||||||
rustup component add rustfmt
|
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
|
cargo fmt -- --check
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in a new issue