Skip to content

feat(elreal): high-precision transcendental hardening suite (identity-driven, #1049) #1092

feat(elreal): high-precision transcendental hardening suite (identity-driven, #1049)

feat(elreal): high-precision transcendental hardening suite (identity-driven, #1049) #1092

Workflow file for this run

name: Sanitizers
on:
schedule:
- cron: '0 6 * * 0' # Weekly on Sunday at 6 AM UTC
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened, ready_for_review ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'docs-site/**'
- '.github/FUNDING.yml'
- 'CITATION.cff'
- 'LICENSE'
- '.clang-format'
- '.clang-tidy'
- '.gitignore'
workflow_dispatch: # Manual trigger
permissions:
contents: read
env:
# Force Node.js 24 for all JavaScript actions (eliminates Node.js 20 deprecation warnings)
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
sanitizers:
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.draft == false
name: "${{ matrix.sanitizer }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- sanitizer: ASan
cmake_flags: -DUNIVERSAL_ENABLE_ASAN=ON
env_vars: ASAN_OPTIONS=detect_leaks=0:halt_on_error=1
- sanitizer: UBSan
cmake_flags: -DUNIVERSAL_ENABLE_UBSAN=ON
env_vars: UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Clang
run: |
sudo apt-get update
sudo apt-get install -y clang
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DUNIVERSAL_BUILD_CI=ON \
${{ matrix.cmake_flags }}
- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc)
- name: Test
working-directory: ${{github.workspace}}/build
env:
ASAN_OPTIONS: ${{ matrix.sanitizer == 'ASan' && 'detect_leaks=0:halt_on_error=1' || '' }}
UBSAN_OPTIONS: ${{ matrix.sanitizer == 'UBSan' && 'print_stacktrace=1:halt_on_error=1' || '' }}
# -j 2 matches the 2-vCPU ubuntu-latest runner; safe under ASan's ~2-3x
# shadow-memory multiplier in 7 GB. --timeout caps any hung instrumented
# test instead of CTest's 1500s default. 300s (not 180s): the slowest
# legitimate test, er_math_hyperbolic, runs ~197s solo under UBSan -O0
# (and longer under -j 2 contention), so 180s failed a correct test.
run: ctest -j 2 --timeout 300 --output-on-failure
- name: Rerun failed tests
if: failure()
working-directory: ${{github.workspace}}/build
env:
ASAN_OPTIONS: ${{ matrix.sanitizer == 'ASan' && 'detect_leaks=0:halt_on_error=1' || '' }}
UBSAN_OPTIONS: ${{ matrix.sanitizer == 'UBSan' && 'print_stacktrace=1:halt_on_error=1' || '' }}
run: ctest -j 2 --timeout 300 --rerun-failed --output-on-failure
- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-logs-${{ matrix.sanitizer }}
path: |
${{github.workspace}}/build/Testing
${{github.workspace}}/build/CMakeCache.txt
${{github.workspace}}/build/CMakeFiles/CMakeOutput.log
${{github.workspace}}/build/CMakeFiles/CMakeError.log