Skip to content

Commit 3e510f6

Browse files
committed
CI cargo clippy deny warnings for benches
1 parent 68fbc8b commit 3e510f6

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,23 @@ jobs:
7777
- name: Install dependencies
7878
if: matrix.os == 'ubuntu-latest'
7979
run: sudo bash ./.github/workflows/install-deps.sh
80-
- name: Install Rust nightly
80+
- name: Install Rust nightly (stable date version)
81+
id: install-rust
8182
run: |
82-
rustup toolchain install nightly
83-
rustup component add clippy --toolchain nightly
83+
STABLE_DATE=$(cargo clippy --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
84+
echo "stable_date=$STABLE_DATE" >> $GITHUB_OUTPUT
85+
86+
rustup toolchain install nightly-$STABLE_DATE
87+
rustup component add clippy --toolchain nightly-$STABLE_DATE
88+
89+
echo "Stable version: $(cargo clippy --version)"
90+
echo "Near stable nightly version: $(cargo +nightly-$STABLE_DATE clippy --version)"
8491
- name: Restore cargo caches
8592
uses: Swatinem/rust-cache@v1
8693
- name: Run clippy
8794
run: cargo clippy --all-features --tests --examples -- -D warnings
88-
- name: Run clippy nightly for benches
89-
run: cargo +nightly clippy --all-features --benches
95+
- name: Run clippy nightly-${{ steps.install-rust.outputs.stable_date }} for benches
96+
run: cargo +nightly-${{ steps.install-rust.outputs.stable_date }} clippy --all-features --benches -- -D warnings -A clippy::incompatible_msrv
9097

9198
check:
9299
strategy:

spdlog/benches/common/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::{
99

1010
use once_cell::sync::Lazy;
1111

12+
#[allow(dead_code)]
1213
pub static BENCH_LOGS_PATH: Lazy<PathBuf> = Lazy::new(|| {
1314
let path = Path::new(env!("OUT_DIR")).join("bench_logs");
1415
if !path.exists() {

spdlog/benches/spdlog-rs/pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{cell::RefCell, sync::Arc};
66

77
use paste::paste;
88
use spdlog::{
9-
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter, RuntimePattern},
9+
formatter::{pattern, Formatter, FullFormatter, Pattern, PatternFormatter},
1010
prelude::*,
1111
sink::Sink,
1212
Record, StringBuf,

0 commit comments

Comments
 (0)