Skip to content

Commit

Permalink
ci: Catch warning in all jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Apr 23, 2024
1 parent ffed4f4 commit daf7113
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
CARGO_LLVM_COV_DENY_WARNINGS: 1

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Workspace {
let rustc = ProcessBuilder::from(config.rustc().clone());
let mut rustc_version = config.rustc_version()?;
rustc_version.nightly =
rustc_version.nightly || std::env::var("RUSTC_BOOTSTRAP").ok().as_deref() == Some("1");
rustc_version.nightly || env::var_os("RUSTC_BOOTSTRAP").unwrap_or_default() == "1";

if doctests && !rustc_version.nightly {
bail!("--doctests flag requires nightly toolchain; consider using `cargo +nightly llvm-cov`")
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ fn main() {
error!("{e:#}");
}
if term::error()
|| term::warn()
&& env::var_os("CARGO_LLVM_COV_DENY_WARNINGS").filter(|v| v == "true").is_some()
|| term::warn() && env::var_os("CARGO_LLVM_COV_DENY_WARNINGS").unwrap_or_default() == "1"
{
std::process::exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/auxiliary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub(crate) fn cargo_llvm_cov(subcommand: &str) -> Command {
if !subcommand.is_empty() {
cmd.arg(subcommand);
}
cmd.env("CARGO_LLVM_COV_DENY_WARNINGS", "true");
cmd.env("CARGO_LLVM_COV_DENY_WARNINGS", "1");
cmd.env_remove("RUSTFLAGS")
.env_remove("RUSTDOCFLAGS")
.env_remove("CARGO_BUILD_RUSTFLAGS")
Expand Down

0 comments on commit daf7113

Please sign in to comment.