Skip to content

Commit

Permalink
Deny warnings in CI
Browse files Browse the repository at this point in the history
The main crate already has `#![deny(warnings)]`. Set RUSTFLAGS in CI to
enforce this for other crates in the workspace.
  • Loading branch information
tgross35 committed May 6, 2024
1 parent a1e8a5b commit 8d6936b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI
on: [push, pull_request]

env:
RUSTDOCFLAGS: -Dwarnings
RUSTFLAGS: -Dwarnings

jobs:
docker:
name: Docker
Expand Down
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ use std::env;

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo::rustc-check-cfg=cfg(assert_no_panic)");
println!("cargo::rustc-check-cfg=cfg(feature, values(\"unstable\"))");

#[cfg(feature = "musl-reference-tests")]
musl_reference_tests::generate();

println!("cargo::rustc-check-cfg=cfg(feature, values(\"checked\"))");
#[allow(unexpected_cfgs)]
if !cfg!(feature = "checked") {
let lvl = env::var("OPT_LEVEL").unwrap();
if lvl != "0" {
Expand Down
1 change: 1 addition & 0 deletions ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ run() {
docker run \
--rm \
--user $(id -u):$(id -g) \
-e "RUSTFLAGS=${RUSTFLAGS:-}" \
-e CARGO_HOME=/cargo \
-e CARGO_TARGET_DIR=/target \
-v "${HOME}/.cargo":/cargo \
Expand Down

0 comments on commit 8d6936b

Please sign in to comment.