Skip to content

gh ci: restore asan on msvc release #72

gh ci: restore asan on msvc release

gh ci: restore asan on msvc release #72

Workflow file for this run

# Copyright (c) Borislav Stanimirov
# SPDX-License-Identifier: MIT
#
name: Unit Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
name: ${{ matrix.cfg.name }}
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
# ubuntu sanitize address, undefined, leak, thread
- {name: 'linux gcc dbg s:addr,ub,leak', os: ubuntu-latest, btype: Debug, cmakeflags: '-DSAN_ADDR=1 -DSAN_UB=1 -DSAN_LEAK=1'}
- {name: 'linux gcc rel s:addr', os: ubuntu-latest, btype: RelWithDebInfo, cmakeflags: '-DSAN_ADDR=1'}
- {name: 'linux gcc rel s:thread', os: ubuntu-latest, btype: RelWithDebInfo, cmakeflags: '-DSAN_THREAD=1'}
# macos - no ub santizer (there are still some apple-specific ub sanitizer issues to fix)
# https://github.com/iboB/dynamix/issues/44
# also no leak sanitizer since it's not supported by apple
- {name: 'mac clang dbg s:addr', os: macos-latest, btype: Debug, cmakeflags: '-DSAN_ADDR=1'}
- {name: 'mac clang rel s:addr', os: macos-latest, btype: RelWithDebInfo, cmakeflags: '-DSAN_ADDR=1'}
- {name: 'mac clang rel s:thread', os: macos-latest, btype: RelWithDebInfo, cmakeflags: '-DSAN_THREAD=1'}
# windows sanitize address
- {name: 'win msvc dbg s:addr', os: windows-latest, btype: Debug, cmakeflags: '-DSAN_ADDR=1'}
- {name: 'win msvc rel s:addr', os: windows-latest, btype: RelWithDebInfo, cmakeflags: '-DSAN_ADDR=1'}
defaults:
run:
working-directory: ci
steps:
- name: Clone
uses: actions/checkout@v3
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: VC Vars
# Setup vcvars on Windows
# MSVC's address sanitizer attaches dependencies to several DLLs which are not in PATH
# vcvars will add them to PATH and allow msvc asan executables to run
if: matrix.cfg.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: 14.38.33130
- name: Configure
run: cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.cfg.btype }} ${{ matrix.cfg.cmakeflags }}
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure
env:
# just set this to all configs, it will be used where it matters and ignored otherwise
UBSAN_OPTIONS: halt_on_error=1