OnDemand Sanitizers Bots #948
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OnDemand Sanitizers Bots | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
schedule: | |
- cron: '0 16 * * *' | |
env: | |
CACHE_EPOCH: 131-1 | |
GOPROXY: direct | |
jobs: | |
sanitizer-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64] | |
build_type: [Debug, Release] | |
sanitizer: | |
- name: address | |
cmake_options: -DASAN=on -DUSE_LIBCXX=on | |
- name: undefined behavior | |
cmake_options: -DUBSAN=on -DUSE_LIBCXX=off | |
- name: thread | |
cmake_options: -DTSAN=on -DUSE_LIBCXX=on | |
- name: memory | |
cmake_options: -DMSAN=on -DUSE_LIBCXX=on -DUSE_CURL=off | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout with shallow submodules | |
run: | | |
# unshallow must come first otherwise submodule may be get unshallowed | |
git fetch --tags --unshallow | |
git submodule update --init --depth 1 | |
- name: Cache toolchain | |
id: toolchain-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
third_party/llvm-build/Release+Asserts | |
key: ${{ runner.os }}-toolchain-${{ hashFiles('CLANG_REVISION') }}-v${{ env.CACHE_EPOCH }} | |
- name: "Install dependency: prebuilt clang and clang-tidy binaries" | |
if: ${{ steps.toolchain-cache.outputs.cache-hit != 'true' }} | |
run: | | |
./scripts/download-clang-prebuilt-binaries.py | |
rm -f third_party/llvm-build/Release+Asserts/*.tgz | |
- name: Change ubuntu mirror | |
run: | | |
sudo sed -i 's/azure.archive.ubuntu.com/azure.archive.ubuntu.com/g' /etc/apt/sources.list | |
sudo apt-get update -qq | |
- name: Populate depedencies | |
run: sudo apt-get update -qq && sudo apt-get install -y cmake ninja-build llvm libcurl4-openssl-dev | |
- name: Populate dependencie (cmake, overwrite) | |
run: | | |
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.29.8/cmake-3.29.8-linux-x86_64.tar.gz | |
sudo tar -C /usr/local --strip-components=1 -xf cmake-3.29.8-linux-x86_64.tar.gz | |
cmake --version | |
rm -f *.tar.gz | |
- name: Set clang environment | |
run: | | |
echo "CC=${{ github.workspace }}/third_party/llvm-build/Release+Asserts/bin/clang" >> $GITHUB_ENV | |
echo "CXX=${{ github.workspace }}/third_party/llvm-build/Release+Asserts/bin/clang++" >> $GITHUB_ENV | |
- name: Build Unittests | |
run: | | |
mkdir build | |
cd build | |
cmake -G Ninja -DBUILD_TESTS=on -DGUI=on \ | |
-DUSE_ZLIB=on -DUSE_JSONCPP=on -DUSE_CARES=on \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
${{ matrix.sanitizer.cmake_options }} .. | |
ninja yass_test | |
cd .. | |
- name: Memory layout fix for old clang | |
run: | | |
# TODO remove this once upstream fix is available | |
# msan fix is here https://github.com/llvm/llvm-project/pull/85142 | |
sudo sysctl -w vm.mmap_rnd_bits=28 | |
- name: Run tests | |
run: | | |
cd build | |
./yass_test -logtostderr -v 1 --gtest_shuffle --gtest_repeat=100 --gtest_throw_on_failure | |
cd .. |