-
Notifications
You must be signed in to change notification settings - Fork 13
137 lines (121 loc) · 4.71 KB
/
ci.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint C++
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: 'file' # Use .clang-format config file
tidy-checks: '' # Use .clang-tidy config file
# only 'update' a single comment in a pull request's thread.
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Clang 17",
os: ubuntu-24.04,
toolchain: "clang-17-toolchain.cmake",
clang_version: 17,
installed_clang_version: 14,
cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "
}
- {
name: "Ubuntu Clang 18",
os: ubuntu-24.04,
toolchain: "clang-18-toolchain.cmake",
clang_version: 18,
installed_clang_version: 14,
cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "
}
- {
name: "Ubuntu Clang 19",
os: ubuntu-24.04,
toolchain: "clang-19-toolchain.cmake",
clang_version: 19,
installed_clang_version: 14,
cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "
}
- {
name: "Ubuntu GCC 13",
os: ubuntu-24.04,
toolchain: "gcc-13-toolchain.cmake",
clang_version: 17,
installed_clang_version: 14,
cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "
}
- {
name: "Ubuntu GCC 14",
os: ubuntu-24.04,
toolchain: "gcc-14-toolchain.cmake",
clang_version: 17,
installed_clang_version: 14,
cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "
}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Install LLVM+Clang
if: startsWith(matrix.config.os, 'ubuntu-')
run: |
cat /etc/lsb-release
sudo apt-get remove clang-${{matrix.config.installed_clang_version}} \
lldb-${{matrix.config.installed_clang_version}} \
lld-${{matrix.config.installed_clang_version}} \
clangd-${{matrix.config.installed_clang_version}} \
clang-tidy-${{matrix.config.installed_clang_version}} \
clang-format-${{matrix.config.installed_clang_version}} \
clang-tools-${{matrix.config.installed_clang_version}} \
llvm-${{matrix.config.installed_clang_version}}-dev \
lld-${{matrix.config.installed_clang_version}} \
lldb-${{matrix.config.installed_clang_version}} \
llvm-${{matrix.config.installed_clang_version}}-tools \
libomp-${{matrix.config.installed_clang_version}}-dev \
libc++-${{matrix.config.installed_clang_version}}-dev \
libc++abi-${{matrix.config.installed_clang_version}}-dev \
libclang-common-${{matrix.config.installed_clang_version}}-dev \
libclang-${{matrix.config.installed_clang_version}}-dev \
libclang-cpp${{matrix.config.installed_clang_version}}-dev \
libunwind-${{matrix.config.installed_clang_version}}-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.config.clang_version}} all
sudo apt-get install libc++-dev libc++1 libc++abi-dev libc++abi1
- name: Install GCC 14
if: matrix.config.name == 'Ubuntu GCC 14'
run: |
sudo apt update
sudo apt-get install g++-14
- name: Configure
run: |
mkdir -p .build
cd .build
echo ${{ matrix.config.cmake_args }}
echo ${{ matrix.config.toolchain }}
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE=etc/${{ matrix.config.toolchain }} -B . -S ..
- name: Build
run: |
cmake --build .build --config Asan --target all -- -k 0
- name: Test
run: |
cd .build
ctest --output-on-failure