Skip to content

Commit

Permalink
ci: deny warnings and add more checks
Browse files Browse the repository at this point in the history
  • Loading branch information
y86-dev committed Apr 20, 2024
1 parent 3367b99 commit 42718b0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ jobs:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
run: cargo clippy -- -D warnings
doc:
runs-on: ubuntu-latest
name: nightly / doc
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jobs:
run: rustup target add ${{ matrix.target }}
- name: cargo check
run: cargo check --target ${{ matrix.target }} --no-default-features
env:
RUSTFLAGS: "-Dwarnings"
18 changes: 14 additions & 4 deletions .github/workflows/safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,24 @@ jobs:
run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu
env:
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address -Dwarnings"
- name: cargo test -Zsanitizer=leak
if: always()
run: cargo test --all-features --target x86_64-unknown-linux-gnu
env:
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak -Dwarnings"
miri:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flags: [
"",
"-Zmiri-tree-borrows",
"-Zmiri-strict-provenance",
"-Zmiri-tree-borrows -Zmiri-strict-provenance"
]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -48,10 +57,11 @@ jobs:
with:
toolchain: ${{ env.NIGHTLY }}
components: miri
- name: cargo miri test
- name: ${{ matrix.flags }} cargo miri test
run: cargo miri test
env:
MIRIFLAGS: ""
RUSTFLAGS: "-Dwarnings"
MIRIFLAGS: ${{ matrix.flags }}
# loom:
# runs-on: ubuntu-latest
# steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
run: cargo generate-lockfile
- name: cargo test --locked
run: cargo test --locked --all-features --all-targets
env:
RUSTFLAGS: "-Dwarnings"
# https://twitter.com/alcuadrado/status/1571291687837732873
update:
runs-on: ubuntu-latest
Expand All @@ -46,4 +48,4 @@ jobs:
- name: cargo test
run: cargo test --locked --all-features --all-targets
env:
RUSTFLAGS: -D deprecated
RUSTFLAGS: -Ddeprecated -Dwarnings
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ jobs:
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
run: cargo test --locked --all-features --all-targets
env:
RUSTFLAGS: "-Dwarnings"
# https://github.com/rust-lang/cargo/issues/6669
- name: cargo test --doc
run: cargo test --locked --all-features --doc
env:
RUSTFLAGS: "-Dwarnings"
os-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / nightly
Expand All @@ -53,4 +57,6 @@ jobs:
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo test
run: cargo test --locked --all-features --all-targets
run: cargo test --locked --all-features --all-targets
env:
RUSTFLAGS: "-Dwarnings"

0 comments on commit 42718b0

Please sign in to comment.