Skip to content

chore: unify vcpkg version to 0.1.0 for ecosystem consistency (#385) #516

chore: unify vcpkg version to 0.1.0 for ecosystem consistency (#385)

chore: unify vcpkg version to 0.1.0 for ecosystem consistency (#385) #516

Workflow file for this run

name: Sanitizer Tests
on:
push:
branches: [ main, phase-* ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
sanitizer-tests:
name: ${{ matrix.sanitizer }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# Ubuntu 24.04 with Clang 18 for full C++20 std::format support
os: [ubuntu-24.04]
sanitizer: [thread, address, undefined]
build_type: [Debug]
steps:
- name: Checkout database_system
uses: actions/checkout@v4
with:
fetch-depth: 0
path: database_system
- name: Checkout common_system
uses: actions/checkout@v4
with:
repository: kcenon/common_system
path: common_system
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
sudo apt-get update
# Use Clang 18 for full C++20 std::format support
sudo apt-get install -y cmake ninja-build clang-18 libgtest-dev libfmt-dev libpq-dev
- name: Set up compiler
run: |
# Use Clang 18 for full C++20 std::format support
echo "CC=clang-18" >> $GITHUB_ENV
echo "CXX=clang++-18" >> $GITHUB_ENV
- name: Build and install common_system
run: |
cd common_system
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DUSE_UNIT_TEST=OFF \
-DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
cmake --build build --config Release
sudo cmake --install build --prefix /usr/local
- name: Configure CMake with ${{ matrix.sanitizer }} sanitizer
run: |
cd database_system
SANITIZER_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer -g"
cmake -B build -S . \
-GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_CXX_FLAGS="${SANITIZER_FLAGS}" \
-DCMAKE_C_FLAGS="${SANITIZER_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}" \
-DALLOW_BUILD_WITHOUT_NETWORK_SYSTEM=ON \
-DUSE_UNIT_TEST=ON \
-DBUILD_DATABASE_SAMPLES=OFF \
-DDATABASE_BUILD_INTEGRATION_TESTS=OFF
- name: Build with ${{ matrix.sanitizer }} sanitizer
run: |
cd database_system
cmake --build build -j
- name: Run tests with ${{ matrix.sanitizer }} sanitizer
run: |
cd database_system/build
ctest --output-on-failure --verbose
env:
TSAN_OPTIONS: "halt_on_error=0 second_deadlock_stack=1"
ASAN_OPTIONS: "halt_on_error=0 detect_leaks=1"
UBSAN_OPTIONS: "halt_on_error=0 print_stacktrace=1"
- name: Upload sanitizer logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: sanitizer-logs-${{ matrix.sanitizer }}-${{ matrix.os }}
path: |
database_system/build/Testing/Temporary/LastTest.log
database_system/build/**/*.log
retention-days: 7
sanitizer-summary:
name: Sanitizer Test Summary
needs: sanitizer-tests
runs-on: ubuntu-24.04
if: always()
steps:
- name: Generate summary
run: |
echo "# Sanitizer Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Phase 0: Baseline Establishment" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Sanitizer tests configured and running." >> $GITHUB_STEP_SUMMARY
echo "Warnings allowed in Phase 0 for baseline establishment." >> $GITHUB_STEP_SUMMARY