Skip to content

Commit ac7d1e9

Browse files
committed
ci: deny warnings
Signed-off-by: Benno Lossin <[email protected]>
1 parent 10eddd2 commit ac7d1e9

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
components: rust-src
4141
- run: git config user.name "github-runner" && git config user.email "<>"
4242
- run: git rebase --exec 'cargo doc --all-features --no-deps' --root
43+
env:
44+
RUSTFLAGS: "-Dwarnings"
4345
clippy:
4446
runs-on: ubuntu-latest
4547
steps:
@@ -54,8 +56,12 @@ jobs:
5456
- run: git config user.name "github-runner" && git config user.email "<>"
5557
# examples and tests require `alloc`, since they make extensive use of `Box` etc.
5658
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset clippy --all-targets --locked --features alloc' --exec 'cargo clean' --root
59+
env:
60+
RUSTFLAGS: "-Dwarnings"
5761
# the core lib does not, so also check that without the alloc feature.
5862
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset clippy --lib --locked' --exec 'cargo clean' --root
63+
env:
64+
RUSTFLAGS: "-Dwarnings"
5965
test:
6066
runs-on: ubuntu-latest
6167
steps:
@@ -66,8 +72,12 @@ jobs:
6672
- run: cargo install cargo-expand
6773
- run: git config user.name "github-runner" && git config user.email "<>"
6874
- run: git rebase --exec 'cargo test --locked --all-targets' --root
75+
env:
76+
RUSTFLAGS: "-Dwarnings"
6977
# doctests are strangely not included in --all-targets
7078
- run: git rebase --exec 'cargo test --locked --doc' --root
79+
env:
80+
RUSTFLAGS: "-Dwarnings"
7181
miri:
7282
runs-on: ubuntu-latest
7383
name: "miri (${{matrix.MIRIFLAGS}})"
@@ -90,10 +100,12 @@ jobs:
90100
- run: git config user.name "github-runner" && git config user.email "<>"
91101
- run: git rebase --exec 'cargo miri test --locked --all-targets' --root
92102
env:
103+
RUSTFLAGS: "-Dwarnings"
93104
MIRIFLAGS: ${{matrix.MIRIFLAGS}}
94105
# doctests are strangely not included in --all-targets
95106
- run: git rebase --exec 'cargo miri test --locked --doc' --root
96107
env:
108+
RUSTFLAGS: "-Dwarnings"
97109
MIRIFLAGS: ${{matrix.MIRIFLAGS}}
98110
sanitizers:
99111
runs-on: ubuntu-latest
@@ -116,20 +128,20 @@ jobs:
116128
- run: git rebase --exec "sed -i '/\[features\]/i [profile.dev]' Cargo.toml && sed -i '/profile.dev/a opt-level = 1' Cargo.toml && cargo test --lib --tests --target x86_64-unknown-linux-gnu && git restore Cargo.toml" --root
117129
env:
118130
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
119-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
131+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address -Dwarnings"
120132
# sed because of https://github.com/japaric/rust-san#unrealiable-leaksanitizer
121133
# doctests are strangely not included in --all-targets
122134
- run: git rebase --exec "sed -i '/\[features\]/i [profile.dev]' Cargo.toml && sed -i '/profile.dev/a opt-level = 1' Cargo.toml && cargo test --doc --target x86_64-unknown-linux-gnu && git restore Cargo.toml" --root
123135
env:
124136
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
125-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
137+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address -Dwarnings"
126138
- run: git rebase --exec 'cargo test --all-targets --target x86_64-unknown-linux-gnu' --root
127139
env:
128-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
140+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak -Dwarnings"
129141
# doctests are strangely not included in --all-targets
130142
- run: git rebase --exec 'cargo test --doc --target x86_64-unknown-linux-gnu' --root
131143
env:
132-
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
144+
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak -Dwarnings"
133145
msrv:
134146
runs-on: ubuntu-latest
135147
steps:
@@ -141,6 +153,8 @@ jobs:
141153
- run: cargo install cargo-hack
142154
- run: git config user.name "github-runner" && git config user.email "<>"
143155
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --exclude-features alloc --exclude-features default --version-range 1.82.. --clean-per-version check --locked --all-targets' --exec 'cargo clean' --root
156+
env:
157+
RUSTFLAGS: "-Dwarnings"
144158
nightly-msrv:
145159
runs-on: ubuntu-latest
146160
steps:
@@ -157,6 +171,7 @@ jobs:
157171
- run: git rebase --exec 'cargo hack --clean-per-run --feature-powerset --version-range 1.78.. --clean-per-version check --locked --all-targets' --exec 'cargo clean' --root
158172
env:
159173
RUSTC_BOOTSTRAP: 1
174+
RUSTFLAGS: "-Dwarnings"
160175
os-check:
161176
strategy:
162177
fail-fast: false
@@ -175,8 +190,12 @@ jobs:
175190
- run: cargo install cargo-expand
176191
- run: git config user.name "github-runner" && git config user.email "<>"
177192
- run: git rebase --exec 'cargo test --all-targets --locked' --root
193+
env:
194+
RUSTFLAGS: "-Dwarnings"
178195
# doctests are strangely not included in --all-targets
179196
- run: git rebase --exec 'cargo test --doc --locked' --root
197+
env:
198+
RUSTFLAGS: "-Dwarnings"
180199
signed-off-by:
181200
runs-on: ubuntu-latest
182201
steps:
@@ -228,3 +247,5 @@ jobs:
228247
- run: sudo apt-get install -y linkchecker
229248
- run: git config user.name "github-runner" && git config user.email "<>"
230249
- run: git rebase --exec 'cargo doc --all-features --no-deps && linkchecker target/doc/*/*.html' --root
250+
env:
251+
RUSTFLAGS: "-Dwarnings"

0 commit comments

Comments
 (0)