Skip to content

Commit 8471644

Browse files
committed
Deny warnings in CI
Since we recently got rid of our last build/test/doc warnings, we now deny warnings via `-D warnings` in CI, enforcing no new ones are introduced.
1 parent 4deb263 commit 8471644

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
run: |
4040
sudo apt-get -y install shellcheck
4141
shellcheck ci/ci-tests.sh
42+
- name: Set RUSTFLAGS to deny warnings
43+
if: "matrix.toolchain == '1.63.0'"
44+
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
4245
- name: Run CI script
4346
shell: bash # Default on Winblows is powershell
4447
run: CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh

ci/ci-tests.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ if [[ "$HOST_PLATFORM" != *windows* ]]; then
9494

9595
DOWNLOAD_ELECTRS_AND_BITCOIND
9696

97-
RUSTFLAGS="--cfg no_download" cargo test --verbose --color always --features esplora-blocking
98-
RUSTFLAGS="--cfg no_download" cargo check --verbose --color always --features esplora-blocking
99-
RUSTFLAGS="--cfg no_download" cargo test --verbose --color always --features esplora-async
100-
RUSTFLAGS="--cfg no_download" cargo check --verbose --color always --features esplora-async
101-
RUSTFLAGS="--cfg no_download" cargo test --verbose --color always --features esplora-async-https
102-
RUSTFLAGS="--cfg no_download" cargo check --verbose --color always --features esplora-async-https
103-
RUSTFLAGS="--cfg no_download" cargo test --verbose --color always --features electrum
104-
RUSTFLAGS="--cfg no_download" cargo check --verbose --color always --features electrum
97+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-blocking
98+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-blocking
99+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-async
100+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-async
101+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-async-https
102+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-async-https
103+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features electrum
104+
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features electrum
105105

106106
popd
107107
fi
@@ -125,7 +125,7 @@ popd
125125
echo -e "\n\nBuilding with all Log-Limiting features"
126126
pushd lightning
127127
grep '^max_level_' Cargo.toml | awk '{ print $1 }'| while read -r FEATURE; do
128-
cargo check --verbose --color always --features "$FEATURE"
128+
RUSTFLAGS="$RUSTFLAGS -A unused_variables -A unused_macros -A unused_imports -A dead_code" cargo check --verbose --color always --features "$FEATURE"
129129
done
130130
popd
131131

@@ -138,9 +138,9 @@ done
138138

139139
for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
140140
# check if there is a conflict between no-std and the c_bindings cfg
141-
RUSTFLAGS="--cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std
141+
RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std
142142
done
143-
RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always
143+
RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test --verbose --color always
144144

145145
# Note that outbound_commitment_test only runs in this mode because of hardcoded signature values
146146
pushd lightning
@@ -174,5 +174,5 @@ if [ -f "$(which arm-none-eabi-gcc)" ]; then
174174
fi
175175

176176
echo -e "\n\nTest cfg-flag builds"
177-
RUSTFLAGS="$RUSTFLAGS --cfg=taproot" cargo test --verbose --color always -p lightning
178-
RUSTFLAGS="$RUSTFLAGS --cfg=async_signing" cargo test --verbose --color always -p lightning
177+
RUSTFLAGS="--cfg=taproot" cargo test --verbose --color always -p lightning
178+
RUSTFLAGS="--cfg=async_signing" cargo test --verbose --color always -p lightning

0 commit comments

Comments
 (0)