diff options
| author | Philipp Krones <hello@philkrones.com> | 2022-06-06 13:12:53 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2022-06-06 16:17:58 +0200 |
| commit | 93056599220db45a67e3ba82484af4718456fefa (patch) | |
| tree | 9f0271f54d6b5e53d763967d0a86f014162c2a8e | |
| parent | 1f11cd17ac4a6d143ef36d4d82358283626afd08 (diff) | |
| download | rust-93056599220db45a67e3ba82484af4718456fefa.tar.gz rust-93056599220db45a67e3ba82484af4718456fefa.zip | |
Book: Improve chapter on CI
Recommend the -Dwarnings and --all-targets/--all-features more strongly.
| -rw-r--r-- | book/src/continuous_integration/README.md | 5 | ||||
| -rw-r--r-- | book/src/continuous_integration/github_actions.md | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/book/src/continuous_integration/README.md b/book/src/continuous_integration/README.md index 9f1374193de..e5c3673bde4 100644 --- a/book/src/continuous_integration/README.md +++ b/book/src/continuous_integration/README.md @@ -1,7 +1,8 @@ # Continuous Integration -It is recommended to run Clippy on CI, preferably with `-Dwarnings`, so that -Clippy lints prevent CI from passing. +It is recommended to run Clippy on CI with `-Dwarnings`, so that Clippy lints +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 your crate for maximum compatibility. E.g. if your crate is compiled with the diff --git a/book/src/continuous_integration/github_actions.md b/book/src/continuous_integration/github_actions.md index 4154c60dbd2..42a43ef1380 100644 --- a/book/src/continuous_integration/github_actions.md +++ b/book/src/continuous_integration/github_actions.md @@ -6,11 +6,16 @@ pre-installed. So all you have to do is to run `cargo clippy`. ```yml on: push name: Clippy check + +# Make sure CI fails on all warnings, including Clippy lints +env: + RUSTFLAGS: "-Dwarnings" + jobs: clippy_check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Run Clippy - run: cargo clippy + run: cargo clippy --all-targets --all-features ``` |
