-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Sanitizers | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
pull_request: | ||
# branches: [master, trying, staging] | ||
|
||
jobs: | ||
sanitizers: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: osgeo/gdal:ubuntu-full-3.6.0 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install build deps | ||
shell: bash | ||
run: | | ||
apt-get update -y | ||
apt-get install build-essential curl pkg-config libclang-dev -y | ||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y | ||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH | ||
- name: Setup building | ||
run: | | ||
export CC="clang-9" | ||
export CXX="clang++-9" | ||
- name: Install Rust nightly | ||
run: | | ||
rustup toolchain install nightly --profile minimal --component rust-src | ||
rustup override set nightly | ||
- name: Get target triple | ||
run: | | ||
echo "TARGET=$(rustc -vV | awk '/^host: / { print $2 }')" >>${GITHUB_ENV} | ||
- name: Run address sanitizer | ||
env: | ||
RUSTFLAGS: -Z sanitizer=address | ||
RUSTDOCFLAGS: -Z sanitizer=address | ||
# Note: because we don't build GDAL with sanitizers, we need to turn off | ||
# leak detection, otherwise it'll report memory leak false positives | ||
ASAN_OPTIONS: verbose=1:atexit=1:detect_stack_use_after_return=1:strict_string_checks=1:detect_leaks=0 | ||
run: cargo test --target ${{ env.TARGET }} |