-
Notifications
You must be signed in to change notification settings - Fork 97
240 lines (193 loc) · 6.54 KB
/
c.yaml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
name: C
on:
workflow_dispatch:
push:
branches:
- master
- staging
tags:
- "*"
pull_request:
paths:
- "c/**"
- .github/workflows/c.yaml
jobs:
ubuntu-lts:
strategy:
matrix:
build_type: [ "Debug", "Release" ]
compiler: [
{ c: "gcc-6", cxx: "g++-6", package: "gcc-6 g++-6" },
{ c: "clang-6.0", cxx: "clang++-6.0", package: "clang-6.0" }
]
build_shared_libraries: [ true, false ]
exclude: [
{ build_type: "Debug", compiler: { c: "gcc-6", cxx: "g++-6" }, build_shared_libraries: false }
]
name: "Ubuntu 18.04 (Build: ${{ matrix.build_type }}, Compilers: ${{ matrix.compiler.c }}/${{ matrix.compiler.cxx }}, Shared Library: ${{ matrix.build_shared_libraries }})"
runs-on: ubuntu-latest
container: ubuntu:18.04
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Setup
run: |
apt-get -qq update
apt-get -qq install software-properties-common gpg wget
add-apt-repository -y ppa:git-core/ppa
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic-rc main' \
| tee -a /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get -qq update
apt-get -qq install libeigen3-dev libserialport-dev git cmake build-essential ${{ matrix.compiler.package }}
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Configure
run: |
cmake -S c -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libraries }} \
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
-DINSTALL_GTEST=false \
-DBUILD_EXAMPLES=true
- name: Build
run: cmake --build build --parallel
- name: Example
run: cmake --build build --parallel --target examples
- name: Test
run: cmake --build build --target do-all-tests
- name: Install
run: cmake --build build --target install
- name: Test Package
run: |
cmake -S c/test_package -B c/test_package/build -DCMAKE_PREFIX_PATH="$PWD/install"
cmake --build c/test_package/build
macos:
name: macOS
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Configure
run: |
cmake -S c -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \
-DINSTALL_GTEST=false
- name: Build
run: cmake --build build
- name: Test
run: cmake --build build --target do-all-tests
- name: Install
run: cmake --build build --target install
- name: Test Package
run: |
cmake -S c/test_package -B c/test_package/build -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install"
cmake --build c/test_package/build
big-endian:
name: Test Big Endian
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu qemu-user g++-mips-linux-gnu
- name: Run big endian tests
run: make test-c-modern
env:
CC: mips-linux-gnu-gcc
CXX: mips-linux-gnu-g++
CMAKEFLAGS: -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-static" -Dgtest_disable_pthreads=ON
bazel:
name: Bazel
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: bazelbuild/setup-bazelisk@v2
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel
- name: Bazel Build & Test
run: |
bazel test //...
asan:
name: ASAN
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: bazelbuild/setup-bazelisk@v2
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel
- name: Bazel Build & Test
run: |
bazel test --config=asan //...
ubsan:
name: UBSAN
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: bazelbuild/setup-bazelisk@v2
- name: Mount bazel cache
uses: actions/cache@v4
with:
path: "~/.cache/bazel"
key: bazel
- name: Bazel Build & Test
run: |
bazel test --config=ubsan //...
windows-2019:
strategy:
matrix:
generator: [ "MinGW Makefiles", "Visual Studio 16 2019" ]
build_shared_libraries: [ true, false ]
name: "Windows 2019 (Generator: ${{ matrix.generator }}, Shared Library: ${{ matrix.build_shared_libraries }})"
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Configure
run: |
cmake -G "${{ matrix.generator }}" -S c -B build `
-DCMAKE_BUILD_TYPE=Release `
-DBUILD_SHARED_LIBS=${{ matrix.build_shared_libraries }} `
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" `
-Dgtest_force_shared_crt=true `
-DINSTALL_GTEST=false
- name: Build
run: cmake --build build
- name: Build Test
run: cmake --build build --target build-all-tests
- name: Run Test
run: cmake --build build --target do-all-tests
if: ${{ !matrix.build_shared_libraries }}
- name: Install
run: cmake --build build --target install
- name: Test Package
run: |
cmake -G "${{ matrix.generator }}" -S c/test_package -B c/test_package/build -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install"
cmake --build c/test_package/build