Book: Improve chapter on CI

Recommend the -Dwarnings and --all-targets/--all-features more strongly.
This commit is contained in:
Philipp Krones 2022-06-06 13:12:53 +02:00
parent 1f11cd17ac
commit 9305659922
No known key found for this signature in database
GPG Key ID: 1CA0DF2AF59D68A5
2 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,8 @@
# Continuous Integration # Continuous Integration
It is recommended to run Clippy on CI, preferably with `-Dwarnings`, so that It is recommended to run Clippy on CI with `-Dwarnings`, so that Clippy lints
Clippy lints prevent CI from passing. prevent CI from passing. To enforce errors on warnings on all `cargo` commands
not just `cargo clippy`, you can set the env var `RUSTFLAGS="-Dwarnings"`.
We recommend to use Clippy from the same toolchain, that you use for compiling We recommend to use Clippy from the same toolchain, that you use for compiling
your crate for maximum compatibility. E.g. if your crate is compiled with the your crate for maximum compatibility. E.g. if your crate is compiled with the

View File

@ -6,11 +6,16 @@ pre-installed. So all you have to do is to run `cargo clippy`.
```yml ```yml
on: push on: push
name: Clippy check name: Clippy check
# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
jobs: jobs:
clippy_check: clippy_check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Run Clippy - name: Run Clippy
run: cargo clippy run: cargo clippy --all-targets --all-features
``` ```