@@ -89,35 +89,32 @@ 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
+ echo "test $WARNS"
106
+ if [[ $WARNS -ne 0 ]]; then
107
+ echo "::warning title=nightly clippy::Detected $WARNS warnings"
108
+ fi
109
+ - name : Run clippy nightly for benches
110
+ run : |
111
+ cargo +nightly clippy --all-features --benches -- -A clippy::incompatible_msrv
112
+
113
+ WARNS=$(cargo +nightly clippy --all-features --benches --message-format=json -- -A clippy::incompatible_msrv | jq -s '[.[] | select(.reason == "compiler-message")] | length')
114
+ echo "test $WARNS"
115
+ if [[ $WARNS -ne 0 ]]; then
116
+ echo "::warning title=nightly clippy::Detected $WARNS warnings"
117
+ fi
121
118
122
119
check :
123
120
strategy :
@@ -158,26 +155,18 @@ jobs:
158
155
run : ./.github/workflows/disable-bench-deps.sh
159
156
- name : Install dependencies
160
157
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)"
158
+ - name : Install Rust nightly
159
+ run : rustup toolchain install nightly
171
160
- name : Restore cargo caches
172
161
uses : Swatinem/rust-cache@v2
173
- - name : Run rustdoc nightly-${{ steps.install-rust.outputs.stable_date }}
162
+ - name : Run rustdoc nightly
174
163
run : |
175
164
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
165
+ cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
166
+ cargo +nightly rustdoc --all-features --verbose -- -D warnings
178
167
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
168
+ cargo +nightly rustdoc --verbose -- -D warnings -A rustdoc::broken-intra-doc-links
169
+ cargo +nightly rustdoc --all-features --verbose -- -D warnings
181
170
182
171
check-msrv :
183
172
strategy :
0 commit comments