|
| 1 | +name: Clang Sanitizer |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + cmakeextra: |
| 7 | + description: "Extra CMake options" |
| 8 | + required: false |
| 9 | + default: "" |
| 10 | + sanitizer: |
| 11 | + description: 'Sanitizer to run' |
| 12 | + required: true |
| 13 | + default: 'address' |
| 14 | + options: ['address', 'thread', 'memory', 'undefined'] |
| 15 | + type: choice |
| 16 | + |
| 17 | +defaults: |
| 18 | + run: |
| 19 | + shell: bash |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + name: "${{ github.event.inputs.sanitizer }}" |
| 24 | + runs-on: 'ubuntu-latest' |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - name: Configure CMake |
| 29 | + run: | |
| 30 | + wget https://apt.llvm.org/llvm-snapshot.gpg.key |
| 31 | + echo "deb [signed-by=$PWD/llvm-snapshot.gpg.key] http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee /etc/apt/sources.list.d/llvm.list |
| 32 | + sudo apt update |
| 33 | + sudo apt install -y libpugixml-dev clang-13 |
| 34 | + # linking a C++ library to a C program fails with ubsan enabled; disable lslver for this run |
| 35 | + sed -i -e'/lslver/d' CMakeLists.txt |
| 36 | + cmake --version |
| 37 | + cmake -S . -B build \ |
| 38 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 39 | + -DCMAKE_C_COMPILER=clang-13 \ |
| 40 | + -DCMAKE_{CXX_COMPILER,LINKER}=clang++-13 \ |
| 41 | + -DCMAKE_{C,CXX,EXE_LINKER,SHARED_LINKER}_FLAGS="-fsanitize=${{ github.event.inputs.sanitizer }}" \ |
| 42 | + -DLSL_COMFY_DEFAULTS=ON \ |
| 43 | + -DLSL_UNITTESTS=ON \ |
| 44 | + -DLSL_BENCHMARKS=ON \ |
| 45 | + -DLSL_BUILD_EXAMPLES=OFF \ |
| 46 | + -DLSL_BUNDLED_PUGIXML=OFF \ |
| 47 | + -DLSL_SLIMARCHIVE=ON \ |
| 48 | + -DLSL_OPTIMIZATIONS=ON \ |
| 49 | + -Dlslgitrevision=${{ github.sha }} \ |
| 50 | + -Dlslgitbranch=${{ github.ref }} \ |
| 51 | + ${{ github.event.inputs.cmakeextra }} |
| 52 | + echo ${PWD} |
| 53 | +
|
| 54 | + - name: make |
| 55 | + run: cmake --build build --config RelWithDebInfo -j |
| 56 | + |
| 57 | + - name: unit tests (internal functions) |
| 58 | + run: catchsegv build/testing/lsl_test_internal --order rand --wait-for-keypress never --durations yes |
| 59 | + timeout-minutes: 10 |
| 60 | + |
| 61 | + - name: unit tests (exported functions) |
| 62 | + run: catchsegv build/testing/lsl_test_exported --order rand --wait-for-keypress never --durations yes |
| 63 | + timeout-minutes: 10 |
| 64 | + if: ${{ success() || failure() }} |
0 commit comments