-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (104 loc) · 3.05 KB
/
Copy pathci.yml
File metadata and controls
120 lines (104 loc) · 3.05 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: [ master ]
paths:
- 'include/**'
- 'src/**'
- 'tests/**'
- 'examples/**'
- 'cmake/**'
- 'externals/**'
- 'CMakeLists.txt'
- '.github/workflows/**'
pull_request:
branches: [ master ]
paths:
- 'include/**'
- 'src/**'
- 'tests/**'
- 'examples/**'
- 'cmake/**'
- 'externals/**'
- 'CMakeLists.txt'
- '.github/workflows/**'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux (GCC 14)
os: ubuntu-latest
examples: 'ON'
cmake_args: ''
- name: macOS (Apple Clang)
os: macos-15
# The examples use std::println, and Apple Clang's libc++ does not
# ship <print> yet. The library and unit tests use std::format and
# std::expected, which this toolchain has.
examples: 'OFF'
cmake_args: ''
- name: Windows (MSVC)
os: windows-latest
examples: 'ON'
cmake_args: '-A x64'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++-14 libx11-dev libxtst-dev libxrandr-dev
echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV"
- name: Print CMake version
run: cmake --version
- name: Configure
run: >
cmake -S . -B build ${{ matrix.cmake_args }}
-DCMAKE_BUILD_TYPE=Release
-DROBOT_BUILD_TESTS=ON
-DROBOT_BUILD_EXAMPLES=${{ matrix.examples }}
- name: Build
run: cmake --build build --config Release --parallel
- name: Unit tests
run: ctest --test-dir build -C Release --output-on-failure
sanitizers:
name: Sanitizers (ASan + UBSan)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++-14 libx11-dev libxtst-dev libxrandr-dev
- name: Configure
env:
CC: gcc-14
CXX: g++-14
run: >
cmake -S . -B build
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DROBOT_BUILD_TESTS=ON
-DROBOT_BUILD_EXAMPLES=OFF
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all"
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
- name: Build
run: cmake --build build --parallel
- name: Unit tests
env:
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
ASAN_OPTIONS: detect_leaks=1
run: ctest --test-dir build --output-on-failure