Skip to content

Commit

Permalink
Draft address sanitizer test
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim committed May 16, 2023
1 parent 613fb77 commit 8566786
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/sanitizer.yml
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 }}

0 comments on commit 8566786

Please sign in to comment.