From e4145bf08bdeb1ad6894dac51d3ab2e0d952ee9c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 5 Jul 2021 02:33:29 +0200 Subject: [PATCH] Deny warnings in CI --- .github/workflows/rust.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f4105230..fc836dfc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -102,8 +102,15 @@ jobs: with: path: target key: ${{ runner.os }}-${{ matrix.target }} + + # We have to append the "-D warnings" flag to .cargo/config rather than + # using the RUSTFLAGS environment variable because if we set RUSTFLAGS + # cargo will ignore the rustflags config in .cargo/config. - name: Check - run: cd ${{ matrix.package }} && cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} + run: | + mkdir -p .cargo + echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config + cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} fmt: runs-on: ubuntu-latest