@@ -89,35 +89,30 @@ jobs:
89
89
- name : Install dependencies
90
90
if : matrix.os == 'ubuntu-latest'
91
91
run : sudo bash ./.github/workflows/install-deps.sh
92
- - name : Install Rust nightly (latest and stable date version)
93
- id : install-rust
92
+ - name : Install Rust nightly
94
93
run : |
95
- STABLE_DATE=$(cargo clippy --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
96
- echo "stable_date=$STABLE_DATE" >> $GITHUB_OUTPUT
97
-
98
94
rustup toolchain install nightly
99
95
rustup component add clippy --toolchain nightly
100
- rustup toolchain install nightly-$STABLE_DATE
101
- rustup component add clippy --toolchain nightly-$STABLE_DATE
102
-
103
- echo "Stable version: $(cargo clippy --version)"
104
- echo "Nightly version: $(cargo +nightly clippy --version)"
105
- echo "Near stable nightly version: $(cargo +nightly-$STABLE_DATE clippy --version)"
106
96
- name : Restore cargo caches
107
97
uses : Swatinem/rust-cache@v2
108
98
- name : Run clippy
109
99
run : cargo clippy --all-features --tests --examples -- -D warnings
110
- - name : Run clippy nightly-${{ steps.install-rust.outputs.stable_date }} for benches
111
- run : cargo +nightly-${{ steps.install-rust.outputs.stable_date }} clippy --all-features --benches -- -D warnings -A clippy::incompatible_msrv
112
- - name : Run clippy nightly-latest without denying warnings
100
+ - name : Run clippy nightly
113
101
run : |
114
102
cargo +nightly clippy --all-features --tests --examples
115
103
116
- echo "## clippy nightly output" >> $GITHUB_STEP_SUMMARY
117
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
118
- # Run it again so there is no noise like "Compiling xxx" and "Checking xxx" in the output.
119
- CARGO_TERM_COLOR=never cargo +nightly clippy --all-features --tests --examples 2>> $GITHUB_STEP_SUMMARY
120
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
104
+ WARNS=$(cargo +nightly clippy --all-features --tests --examples --message-format=json | jq -s '[.[] | select(.reason == "compiler-message")] | length')
105
+ if [[ $WARNS -ne 0 ]]; then
106
+ echo "::warning title=nightly clippy::Detected $WARNS warnings"
107
+ fi
108
+ - name : Run clippy nightly for benches
109
+ run : |
110
+ cargo +nightly clippy --all-features --benches -- -A clippy::incompatible_msrv
111
+
112
+ WARNS=$(cargo +nightly clippy --all-features --benches --message-format=json -- -A clippy::incompatible_msrv | jq -s '[.[] | select(.reason == "compiler-message")] | length')
113
+ if [[ $WARNS -ne 0 ]]; then
114
+ echo "::warning title=nightly clippy::Detected $WARNS warnings"
115
+ fi
121
116
122
117
check :
123
118
strategy :
@@ -158,26 +153,18 @@ jobs:
158
153
run : ./.github/workflows/disable-bench-deps.sh
159
154
- name : Install dependencies
160
155
run : sudo bash ./.github/workflows/install-deps.sh
161
- - name : Install Rust nightly (stable date version)
162
- id : install-rust
163
- run : |
164
- STABLE_DATE=$(rustdoc --version | perl -ne 'print $& if /\b\d{4}-\d{2}-\d{2}\b/')
165
- echo "stable_date=$STABLE_DATE" >> $GITHUB_OUTPUT
166
-
167
- rustup toolchain install nightly-$STABLE_DATE
168
-
169
- echo "Stable version: $(rustdoc --version)"
170
- echo "Near stable nightly version: $(rustdoc +nightly-$STABLE_DATE --version)"
156
+ - name : Install Rust nightly
157
+ run : rustup toolchain install nightly
171
158
- name : Restore cargo caches
172
159
uses : Swatinem/rust-cache@v2
173
- - name : Run rustdoc nightly-${{ steps.install-rust.outputs.stable_date }}
160
+ - name : Run rustdoc nightly
174
161
run : |
175
162
cd spdlog
176
- cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
177
- cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --all-features --verbose -- -D warnings
163
+ cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
164
+ cargo +nightly rustdoc --all-features --verbose -- -D warnings
178
165
cd ../spdlog-macros
179
- cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
180
- cargo +nightly-${{ steps.install-rust.outputs.stable_date }} rustdoc --all-features --verbose -- -D warnings
166
+ cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
167
+ cargo +nightly rustdoc --all-features --verbose -- -D warnings
181
168
182
169
check-msrv :
183
170
strategy :
0 commit comments