From 85e329a32f36e165f72686c9f7b419eaf7b798e8 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 9 May 2024 21:51:56 +1000 Subject: [PATCH] ci: Fail build on warnings --- .github/workflows/ci.yml | 2 +- Cargo.toml | 1 + src/lib.rs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8794cea..2528d1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - name: Build - run: cargo build --all --verbose + run: cargo build --all --verbose --features strict - name: Tests run: cargo test --all --verbose diff --git a/Cargo.toml b/Cargo.toml index 6fbfd55..a6c4069 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ rust-version = "1.78.0" [features] std = [] +strict = [] # For CI builds, fails on warnings [dependencies] can-dbc = "6.0.0" diff --git a/src/lib.rs b/src/lib.rs index c6fbee1..5f9a9c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,7 @@ //! ``` #![deny(missing_docs)] +#![cfg_attr(feature = "strict", deny(warnings))] #![deny(clippy::arithmetic_side_effects)] use anyhow::{anyhow, ensure, Context, Result};