-
Notifications
You must be signed in to change notification settings - Fork 52
100 lines (88 loc) · 3.99 KB
/
native-build.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Native build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
merge_group:
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
# The CMake configure and build commands are platform-agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
compiler-version: [11, 12, 13, 16, 17, 18]
warnings: [ "-Wall -Wextra -Werror " ]
build-type: [Release]
expensive-tests: [true]
additional-cmake-options: [""]
exclude:
- compiler: gcc
compiler-version: 16
- compiler: gcc
compiler-version: 17
- compiler: gcc
compiler-version: 18
- compiler: clang
compiler-version: 11
- compiler: clang
compiler-version: 12
- compiler: clang
compiler-version: 13
include:
- compiler: clang
compiler-version: 16
asan-flags: "-fsanitize=address -fno-omit-frame-pointer"
build-type: RelWithDebInfo
expensive-tests: false
- compiler: clang
compiler-version: 16
ubsan-flags: " -fsanitize=undefined"
build-type: RelWithDebInfo
expensive-tests: false
- compiler: clang
compiler-version: 17
build-type: Debug
expensive-tests: false
ubsan-flags: " -fsanitize=thread -O1 -g"
additional-cmake-options: "-D_NO_TIMING_TESTS=ON"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install dependencies
uses: ./.github/workflows/install-dependencies-ubuntu
- name: Install compiler
uses: ./.github/workflows/install-compiler-ubuntu
with:
compiler: ${{matrix.compiler}}
compiler-version: ${{matrix.compiler-version}}
- name: Reduce address randomization to make sanitizers work
# For details see for example `https://stackoverflow.com/questions/77850769/fatal-threadsanitizer-unexpected-memory-mapping-when-running-on-linux-kernels`
run: |
sudo sysctl vm.mmap_rnd_bits
sudo sysctl vm.mmap_rnd_bits=28
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_TOOLCHAIN_FILE="$(pwd)/toolchains/${{matrix.compiler}}${{matrix.compiler-version}}.cmake" -DADDITIONAL_COMPILER_FLAGS="${{matrix.warnings}} ${{matrix.asan-flags}} ${{matrix.ubsan-flags}}" -DUSE_PARALLEL=true -DRUN_EXPENSIVE_TESTS=${{matrix.expensive-tests}} -DENABLE_EXPENSIVE_CHECKS=true ${{matrix.additional-cmake-options}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}} -- -j $(nproc)
- name: Test
working-directory: ${{github.workspace}}/build/test
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: env CTEST_OUTPUT_ON_FAILURE=1 ctest -C ${{matrix.build-type}} .
- name: Running and printing the benchmark examples.
run: ${{github.workspace}}/build/benchmark/BenchmarkExamples -p
- name: E2E
run: ${{github.workspace}}/e2e/e2e.sh