-
Notifications
You must be signed in to change notification settings - Fork 393
221 lines (171 loc) · 6.13 KB
/
test.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
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
name: test
on: [push, pull_request]
env:
CMAKE_FLAGS: -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS="-Werror"
jobs:
ubuntu:
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04]
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt install liblua5.3-dev lua5.3 libjchart2d-java libglib2.0-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build ${{env.CMAKE_FLAGS}} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
- name: Install
run: sudo cmake --install ${{github.workspace}}/build
- name: Build C Example
working-directory: ${{github.workspace}}/examples/c
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
- name: Build C++ Example
working-directory: ${{github.workspace}}/examples/cpp
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
- name: Build and Run C++ Log Writer Example
working-directory: ${{github.workspace}}/examples/cpp/lcm_log_writer
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
LD_LIBRARY_PATH=/usr/local/lib/ build/lcm_log_writer build/example.log
fedora:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Build and Start Container
run: |
docker build -f docker/Dockerfile.fedora -t lcm-fedora docker
docker run -v $(pwd):/work -d --rm -it --name lcm-fedora lcm-fedora /bin/bash
- name: Configure CMake
run: docker exec lcm-fedora cmake -B ${{github.workspace}}/build ${{env.CMAKE_FLAGS}} -DCMAKE_BUILD_TYPE=Debug
- name: Build
run: docker exec lcm-fedora cmake --build ${{github.workspace}}/build
- name: Test
run: docker exec lcm-fedora ctest --test-dir ${{github.workspace}}/build --output-on-failure
- name: Install
run: docker exec lcm-fedora cmake --install ${{github.workspace}}/build
- name: Build C Example
run: |
docker exec --workdir /work/examples/c -e PKG_CONFIG_PATH=/usr/local/lib/pkgconfig lcm-fedora cmake -B build ${{env.CMAKE_FLAGS}}
docker exec --workdir /work/examples/c lcm-fedora cmake --build build
- name: Build C++ Example
run: |
docker exec --workdir /work/examples/cpp -e PKG_CONFIG_PATH=/usr/local/lib/pkgconfig lcm-fedora cmake -B build ${{env.CMAKE_FLAGS}}
docker exec --workdir /work/examples/cpp lcm-fedora cmake --build build
- name: Build and Run C++ Log Writer Example
working-directory: ${{github.workspace}}/examples/cpp/lcm_log_writer
run: |
docker exec --workdir /work/examples/cpp/lcm_log_writer -e PKG_CONFIG_PATH=/usr/local/lib/pkgconfig lcm-fedora cmake -B build ${{env.CMAKE_FLAGS}}
docker exec --workdir /work/examples/cpp/lcm_log_writer lcm-fedora cmake --build build
docker exec --workdir /work/examples/cpp/lcm_log_writer -e LD_LIBRARY_PATH=/usr/local/lib/ lcm-fedora build/lcm_log_writer build/example.log
macos:
strategy:
matrix:
os: [macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
brew install lua
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build ${{env.CMAKE_FLAGS}}
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
- name: Install
run: sudo cmake --install ${{github.workspace}}/build
- name: Build C Example
working-directory: ${{github.workspace}}/examples/c
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
- name: Build C++ Example
working-directory: ${{github.workspace}}/examples/cpp
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
- name: Build and Run C++ Log Writer Example
working-directory: ${{github.workspace}}/examples/cpp/lcm_log_writer
run: |
cmake -B build ${{env.CMAKE_FLAGS}}
cmake --build build
build/lcm_log_writer build/example.log
windows:
strategy:
matrix:
os: [windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: false
install: >-
git
make
pacboy: >-
toolchain:p
cmake:p
glib2:p
gtest:p
- name: Configure CMake
run: cmake -B build -DPython_FIND_REGISTRY=NEVER
- name: Build
run: cmake --build build
# Needs to be installed for the tests to be able to find DLLs.
- name: Install
run: cmake --install build --prefix /mingw64/
- name: Test
run: |
cd build
# Copy DLLs that don't get installed into the directories of the tests that need them.
cp test/types/liblcm-test-types.dll test/c/
ctest --output-on-failure
docs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt install doxygen liblua5.4-dev lua5.4 python3-sphinx-rtd-theme python3-sphinx python3-myst-parser libglib2.0-dev
- name: Build Docs
run: |
cmake -B ${{github.workspace}}/build
cd build
make doc
- name: Archive Docs
uses: actions/upload-artifact@v4
with:
name: archived-docs
path: build/docs/_build
formatting:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt install clang-format-15
- name: Check formatting
run: |
./format_code.sh
git diff --exit-code