diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml deleted file mode 100644 index 5604b7e..0000000 --- a/.github/workflows/asan.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Address sanitizer -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/checkout@v3 - - name: cargo test -Zsanitizer=address - uses: actions-rs/cargo@v1 - with: - command: test - # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 - args: --lib --tests --all-features --target x86_64-unknown-linux-gnu - env: - ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" - RUSTFLAGS: "-Z sanitizer=address" diff --git a/.github/workflows/loom.yml b/.github/workflows/loom.yml deleted file mode 100644 index 8cfe45d..0000000 --- a/.github/workflows/loom.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Loom -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - uses: actions/checkout@v3 - - name: cargo test --test loom - uses: actions-rs/cargo@v1 - with: - command: test - args: --release --test loom - env: - LOOM_MAX_PREEMPTIONS: 2 - RUSTFLAGS: "--cfg loom" diff --git a/.github/workflows/lsan.yml b/.github/workflows/lsan.yml deleted file mode 100644 index a966913..0000000 --- a/.github/workflows/lsan.yml +++ /dev/null @@ -1,32 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Leak sanitizer -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/checkout@v3 - - run: | - # to get the symbolizer for debug symbol resolution - sudo apt install llvm - # to fix buggy leak analyzer: - # https://github.com/japaric/rust-san#unrealiable-leaksanitizer - sed -i '/\[features\]/i [profile.dev]' Cargo.toml - sed -i '/profile.dev/a opt-level = 1' Cargo.toml - cat Cargo.toml - name: Enable debug symbols - - name: cargo test -Zsanitizer=leak - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --target x86_64-unknown-linux-gnu - env: - RUSTFLAGS: "-Z sanitizer=leak" - LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml deleted file mode 100644 index ae9539a..0000000 --- a/.github/workflows/miri.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Miri -jobs: - test: - runs-on: ubuntu-latest - steps: - - run: | - echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ env.NIGHTLY }} - override: true - components: miri - - uses: actions/checkout@v3 - - name: cargo miri test - uses: actions-rs/cargo@v1 - with: - command: miri - args: test - env: - MIRIFLAGS: "-Zmiri-tag-raw-pointers" diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml new file mode 100644 index 0000000..86fc9ee --- /dev/null +++ b/.github/workflows/safety.yml @@ -0,0 +1,86 @@ +on: + push: + branches: [main] + pull_request: +name: safety +jobs: + sanitizers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + default: true + - run: | + # to get the symbolizer for debug symbol resolution + sudo apt install llvm + # to fix buggy leak analyzer: + # https://github.com/japaric/rust-san#unrealiable-leaksanitizer + sed -i '/\[features\]/i [profile.dev]' Cargo.toml + sed -i '/profile.dev/a opt-level = 1' Cargo.toml + cat Cargo.toml + name: Enable debug symbols + - name: cargo test -Zsanitizer=address + uses: actions-rs/cargo@v1 + with: + command: test + # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 + args: --lib --tests --all-features --target x86_64-unknown-linux-gnu + env: + ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" + RUSTFLAGS: "-Z sanitizer=address" + - name: cargo test -Zsanitizer=leak + if: always() + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --target x86_64-unknown-linux-gnu + env: + LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" + RUSTFLAGS: "-Z sanitizer=leak" + miri: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - run: | + echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV + - name: Install ${{ env.NIGHTLY }} + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.NIGHTLY }} + default: true + components: miri + - name: cargo miri test + uses: actions-rs/cargo@v1 + with: + command: miri + args: test + env: + MIRIFLAGS: "-Zmiri-tag-raw-pointers" + loom: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + - name: cargo test --test loom + uses: actions-rs/cargo@v1 + with: + command: test + args: --release --test loom + env: + LOOM_MAX_PREEMPTIONS: 2 + RUSTFLAGS: "--cfg loom"