Skip to content

Commit a08cc5b

Browse files
committed
Deny warnings on CI to keep codebase warning-free
There's a ton of platforms here that we compile for and so it's only really all covered on CI. To help keep warnings out for everyone let's deny warnings on CI.
1 parent e7cbd9b commit a08cc5b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ jobs:
5252
- name: Install Rust (rustup)
5353
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
5454
shell: bash
55+
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
56+
shell: bash
5557
# full fidelity of backtraces on 32-bit msvc requires frame pointers, so
5658
# enable that for our tests
5759
- name: Force frame pointers
58-
run: echo RUSTFLAGS=-Cforce-frame-pointers >> $GITHUB_ENV
60+
run: echo RUSTFLAGS="-Cforce-frame-pointers $RUSTFLAGS" >> $GITHUB_ENV
5961
shell: bash
6062
if: matrix.thing == 'windows-msvc32'
6163
- run: cargo build --manifest-path crates/backtrace-sys/Cargo.toml
@@ -99,6 +101,8 @@ jobs:
99101
- name: Install Rust
100102
run: rustup update stable --no-self-update && rustup default stable
101103
shell: bash
104+
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
105+
shell: bash
102106
- run: rustup target add aarch64-pc-windows-msvc
103107
- run: cargo test --no-run --target aarch64-pc-windows-msvc
104108
- run: cargo test --no-run --target aarch64-pc-windows-msvc --features verify-winapi
@@ -122,6 +126,7 @@ jobs:
122126
submodules: true
123127
- run: rustup target add ${{ matrix.target }}
124128
- run: |
129+
export RUSTFLAGS=-Dwarnings
125130
export SDK_PATH=`xcrun --show-sdk-path --sdk ${{ matrix.sdk }}`
126131
export RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$SDK_PATH"
127132
cargo test --no-run --target ${{ matrix.target }}
@@ -156,6 +161,8 @@ jobs:
156161
run: rustup update stable && rustup default stable
157162
- run: rustup target add ${{ matrix.target }}
158163
- run: cargo generate-lockfile
164+
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
165+
shell: bash
159166
- run: ./ci/run-docker.sh ${{ matrix.target }}
160167

161168
rustfmt:
@@ -182,6 +189,8 @@ jobs:
182189
- name: Install Rust
183190
run: rustup update nightly && rustup default nightly
184191
- run: rustup target add ${{ matrix.target }}
192+
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
193+
shell: bash
185194
- run: cargo build --target ${{ matrix.target }}
186195

187196
msrv:

ci/run-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ run() {
1818
--volume `pwd`/target:/checkout/target \
1919
--workdir /checkout \
2020
--privileged \
21+
--env RUSTFLAGS \
2122
backtrace \
2223
bash \
2324
-c 'PATH=$PATH:/rust/bin exec ci/run.sh'

0 commit comments

Comments
 (0)