Skip to content

ORC-1841: [C++][CI] Add UBSAN support to Cmake #24

ORC-1841: [C++][CI] Add UBSAN support to Cmake

ORC-1841: [C++][CI] Add UBSAN support to Cmake #24

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Address/Undefined Sanitizer Tests
on:
pull_request:
paths-ignore:
- 'site/**'
- 'conan/**'
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
asan-test:
name: "ASAN with ${{ matrix.compiler }} on Ubuntu"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
include:
- compiler: gcc
cc: gcc
cxx: g++
- compiler: clang
cc: clang
cxx: clang++
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure and Build with ASAN and UBSAN
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON -DENABLE_UBSAN=ON -DBUILD_ENABLE_AVX512=ON -DBUILD_CPP_ENABLE_METRICS=ON -DBUILD_JAVA=OFF
make
- name: Run Tests
working-directory: build
env:
ASAN_OPTIONS: detect_leaks=1:symbolize=1:strict_string_checks=1:halt_on_error=0:detect_container_overflow=0
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan-suppressions.txt
UBSAN_OPTIONS: print_stacktrace=1
run: |
ctest --output-on-failure