Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/lsan-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Intel GPU OpenCL driver initialization allocations.
leak:libigdrcl.so

# Intel OpenCL adapter queue/event/context leaks reported at process exit.
leak:libur_adapter_opencl.so
54 changes: 54 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,60 @@ jobs:
name: documentation
path: target/doc

hardening:
if: github.event_name != 'schedule'
runs-on: ["oneapi-rs", "Linux"]

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup oneAPI
uses: ./.github/actions/setup-oneapi

- name: Install nightly toolchain
run: rustup toolchain install nightly --profile minimal

- name: Build and test with hardening flags
env:
RUSTFLAGS: -Zemit-stack-sizes -Zcf-protection=full
CARGO_TARGET_DIR: target/hardened
run: |
cargo +nightly test --workspace --verbose
cargo +nightly build --workspace --release --verbose

sanitizers:
name: Sanitizer (${{ matrix.sanitizer }})
if: github.event_name != 'schedule'
runs-on: ["oneapi-rs", "Linux"]
strategy:
fail-fast: false
matrix:
# TODO add thread sanitizer
sanitizer: [address, leak]
env:
CARGO_TARGET_DIR: target/sanitizer-${{ matrix.sanitizer }}

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Setup oneAPI
uses: ./.github/actions/setup-oneapi

- name: Install nightly toolchain
run: rustup toolchain install nightly --profile minimal

- name: Run tests with sanitizers
env:
# Test only CPU to avoid issues with GPU drivers and sanitizers
ONEAPI_DEVICE_SELECTOR: opencl:cpu
# Leave leak detection to the dedicated leak sanitizer job.
ASAN_OPTIONS: detect_leaks=0
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan-suppressions.txt
RUSTFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
run: |
cargo +nightly test \
--workspace --lib --tests --target x86_64-unknown-linux-gnu --verbose

trivy:
name: Trivy scan
runs-on: ubuntu-latest
Expand Down
Loading