-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2.05 KB
/
tsan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Threading
on:
workflow_call:
inputs:
testDir:
description: 'Name of the test directory'
default: 'tests'
required: false
type: string
# TODO(picanumber): Specify testing framework
compiler_package:
description: 'pkg name of the compiler to install, e.g. clang-12'
default: 'g++-11'
required: false
type: string
compiler_name:
description: 'name of the compiler executable, e.g. clang++-12'
default: 'g++-11'
required: false
type: string
env:
BUILD_TYPE: Release
INSTALL_LOCATION: .local
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v3
- name: Install compiler
run: |
sudo apt update
sudo apt install -y ${{ inputs.compiler_package }}
- name: cache dependencies
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/${{ env.INSTALL_LOCATION }}
key: ${{ runner.os }}-dependencies
- name: install GoogleTest
if: ${{ steps.cache.output.cache-hit != 'true' }}
run: |
cd ..
git clone https://github.com/google/googletest.git --branch release-1.10.0
cd googletest
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/$INSTALL_LOCATION
cmake --build build --config Release
cmake --build build --target install --config Release
- name: configure
env:
CXX: ${{ inputs.compiler_name }}
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/$INSTALL_LOCATION -DCMAKE_CXX_FLAGS="-fsanitize=thread -g" -DCMAKE_C_FLAGS="-fsanitize=thread -g" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=thread"
- name: build
run: cmake --build build --config $BUILD_TYPE -j4
- name: run tests
run: |
cd build/${{ inputs.testDir }}
ctest -C $BUILD_TYPE -VV