Skip to content

Commit 609d074

Browse files
ci (#10)
1 parent be05e67 commit 609d074

16 files changed

Lines changed: 977 additions & 82 deletions

File tree

.clang-tidy.in

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 318 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,318 @@
1+
name: Linux+MacOS Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
release:
9+
types:
10+
- published
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
formatting:
18+
runs-on: ubuntu-latest
19+
container: ghcr.io/motis-project/docker-cpp-build
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Format files
24+
run: |
25+
find base libs modules test \
26+
-type f -a \( -name "*.cc" -o -name "*.h" -o -name ".cuh" -o -name ".cu" \) \
27+
-print0 | xargs -0 clang-format-16 -i
28+
29+
- name: Check for differences
30+
run: |
31+
git config --global --add safe.directory `pwd`
32+
git status --porcelain
33+
git status --porcelain | xargs -I {} -0 test -z \"{}\"
34+
35+
msvc:
36+
runs-on: windows-latest
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
config:
42+
- mode: Debug
43+
- mode: Release
44+
45+
env:
46+
CXX: cl.exe
47+
CC: cl.exe
48+
BUILDCACHE_COMPRESS: true
49+
BUILDCACHE_DIRECT_MODE: true
50+
BUILDCACHE_ACCURACY: SLOPPY # not suitable for coverage/debugging
51+
BUILDCACHE_DIR: ${{ github.workspace }}/.buildcache
52+
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
53+
CLICOLOR_FORCE: 1
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Install ninja
59+
run: choco install ninja
60+
61+
- name: Restore buildcache Cache
62+
uses: actions/cache/restore@v4
63+
id: restore-buildcache
64+
with:
65+
path: ${{ github.workspace }}/.buildcache
66+
key: buildcache-wnds-${{ matrix.config.mode }}-${{ hashFiles('.pkg') }}-${{ hashFiles('**/*.h') }}-${{ hashFiles('**/*.cc') }}
67+
restore-keys: |
68+
buildcache-wnds-${{ matrix.config.mode }}-${{ hashFiles('.pkg') }}-${{ hashFiles('**/*.h') }}
69+
buildcache-wnds-${{ matrix.config.mode }}-${{ hashFiles('.pkg') }}-
70+
buildcache-wnds-${{ matrix.config.mode }}-
71+
72+
- name: Dependencies Cache
73+
uses: actions/cache@v4
74+
with:
75+
path: ${{ github.workspace }}/deps
76+
key: deps-${{ hashFiles('.pkg') }}
77+
restore-keys: deps-
78+
79+
- uses: ilammy/msvc-dev-cmd@v1
80+
81+
- name: Build
82+
run: |
83+
cmake `
84+
-GNinja -S . -B build `
85+
-DCMAKE_BUILD_TYPE=${{ matrix.config.mode }}
86+
.\build\buildcache\bin\buildcache.exe -z
87+
cmake --build build --target osr-extract osr-backend osr-benchmark osr-test
88+
$CompilerExitCode = $LastExitCode
89+
.\build\buildcache\bin\buildcache.exe -s
90+
exit $CompilerExitCode
91+
92+
# ==== TESTS ====
93+
- name: Run Tests
94+
run: .\build\osr-test.exe
95+
96+
# ==== SAVE CACHE ====
97+
- name: Save buildcache Cache
98+
if: always()
99+
uses: actions/cache/save@v4
100+
with:
101+
path: ${{ github.workspace }}/.buildcache
102+
key: ${{ steps.restore-buildcache.outputs.cache-primary-key }}
103+
104+
# ==== DISTRIBUTION ====
105+
- name: Create Distribution
106+
if: matrix.config.mode == 'Release'
107+
run: |
108+
mkdir dist
109+
mv web dist
110+
mv .\build\osr-extract.exe dist
111+
mv .\build\osr-backend.exe dist
112+
cd dist
113+
7z a osr-windows.zip *
114+
mv osr-windows.zip ..
115+
116+
- name: Upload Distribution
117+
if: matrix.config.mode == 'Release'
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: osr-windows
121+
path: dist
122+
123+
# ==== RELEASE ====
124+
- name: Upload Release
125+
if: github.event.action == 'published' && matrix.config.mode == 'Release'
126+
uses: actions/upload-release-asset@v1.0.2
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
with:
130+
upload_url: ${{ github.event.release.upload_url }}
131+
asset_path: ./osr-windows.zip
132+
asset_name: osr-windows.zip
133+
asset_content_type: application/zip
134+
135+
macos:
136+
runs-on: ${{ matrix.config.os }}
137+
strategy:
138+
fail-fast: false
139+
matrix:
140+
config:
141+
- preset: macos-x86_64
142+
os: macos-13
143+
- preset: macos-arm64
144+
os: macos-14
145+
env:
146+
BUILDCACHE_COMPRESS: true
147+
BUILDCACHE_DIRECT_MODE: true
148+
BUILDCACHE_ACCURACY: SLOPPY
149+
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
150+
BUILDCACHE_DIR: ${{ github.workspace }}/.buildcache
151+
BUILDCACHE_MAX_CACHE_SIZE: 1073741824
152+
BUILDCACHE_DEBUG: 0
153+
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
154+
ASAN_OPTIONS: alloc_dealloc_mismatch=0
155+
CLICOLOR_FORCE: 1
156+
steps:
157+
- uses: actions/checkout@v4
158+
159+
# ==== RESTORE CACHE ====
160+
- name: Restore buildcache Cache
161+
uses: actions/cache/restore@v4
162+
id: restore-buildcache
163+
with:
164+
path: ${{ github.workspace }}/.buildcache
165+
key: buildcache-${{ matrix.config.preset }}-${{ hashFiles('.pkg') }}-${{ hashFiles('**/*.h') }}-${{ hashFiles('**/*.cc') }}
166+
restore-keys: |
167+
buildcache-${{ matrix.config.preset }}-${{ hashFiles('.pkg') }}-${{ hashFiles('**/*.h') }}-
168+
buildcache-${{ matrix.config.preset }}-${{ hashFiles('.pkg') }}-
169+
buildcache-${{ matrix.config.preset }}-
170+
171+
- name: Restore Dependencies Cache
172+
uses: actions/cache/restore@v4
173+
id: restore-deps-cache
174+
with:
175+
path: ${{ github.workspace }}/deps
176+
enableCrossOsArchive: true
177+
key: deps-${{ hashFiles('.pkg') }}
178+
restore-keys: |
179+
deps-
180+
181+
- name: Install Ninja
182+
run: brew install ninja
183+
184+
# ==== BUILD ====
185+
- name: CMake
186+
run: |
187+
git config --global --add safe.directory `pwd`
188+
cmake -G Ninja -S . -B build --preset=${{ matrix.config.preset }}
189+
190+
- name: Build
191+
run: cmake --build build --target osr-extract osr-backend osr-benchmark osr-test
192+
193+
# ==== TESTS ====
194+
- name: Run Tests
195+
run: ./build/osr-test
196+
197+
# ==== DISTRIBUTION ====
198+
- name: Create Distribution
199+
run: |
200+
mkdir osr
201+
mv build/osr-extract osr/osr-extract
202+
mv build/osr-backend osr/osr-backend
203+
tar cjf osr-${{ matrix.config.preset }}.tar.bz2 osr
204+
205+
- name: Upload Distribution
206+
uses: actions/upload-artifact@v4
207+
with:
208+
name: osr-${{ matrix.config.preset }}
209+
path: osr-${{ matrix.config.preset }}.tar.bz2
210+
211+
# ==== RELEASE ====
212+
- name: Upload Release
213+
if: github.event.action == 'published'
214+
uses: actions/upload-release-asset@v1.0.2
215+
env:
216+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
217+
with:
218+
upload_url: ${{ github.event.release.upload_url }}
219+
asset_path: ./osr-${{ matrix.config.preset }}.tar.bz2
220+
asset_name: osr-${{ matrix.config.preset }}.tar.bz2
221+
asset_content_type: application/x-tar
222+
223+
# ==== SAVE CACHE ====
224+
- name: Save buildcache Cache
225+
if: always()
226+
uses: actions/cache/save@v4
227+
with:
228+
path: ${{ github.workspace }}/.buildcache
229+
key: ${{ steps.restore-buildcache.outputs.cache-primary-key }}
230+
231+
- name: Save Dependencies Cache
232+
if: always()
233+
uses: actions/cache/save@v4
234+
with:
235+
path: ${{ github.workspace }}/deps
236+
key: ${{ steps.restore-deps-cache.outputs.cache-primary-key }}
237+
enableCrossOsArchive: true
238+
239+
linux:
240+
runs-on: [ self-hosted, linux, x64, "${{ matrix.config.preset }}" ]
241+
container:
242+
image: ghcr.io/motis-project/docker-cpp-build
243+
volumes:
244+
- ${{ github.event.repository.name }}-${{ matrix.config.preset }}-deps:/deps
245+
- ${{ github.event.repository.name }}-${{ matrix.config.preset }}-buildcache:/buildcache
246+
strategy:
247+
fail-fast: false
248+
matrix:
249+
config:
250+
- preset: linux-amd64-release
251+
artifact: linux-amd64
252+
- preset: linux-arm64-release
253+
artifact: linux-arm64
254+
emulator: qemu-aarch64-static
255+
- preset: clang-tidy
256+
- preset: linux-sanitizer
257+
- preset: linux-debug
258+
emulator: valgrind --leak-check=full --error-exitcode=1
259+
env:
260+
BUILDCACHE_DIR: /buildcache
261+
BUILDCACHE_COMPRESS: true
262+
BUILDCACHE_ACCURACY: SLOPPY
263+
BUILDCACHE_DIRECT_MODE: true
264+
BUILDCACHE_MAX_CACHE_SIZE: 2147483648
265+
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
266+
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
267+
ASAN_OPTIONS: alloc_dealloc_mismatch=0
268+
steps:
269+
- uses: actions/checkout@v4
270+
271+
- name: Get deps
272+
run: ln -s /deps deps
273+
274+
- name: CMake
275+
run: |
276+
git config --global --add safe.directory `pwd`
277+
cmake -G Ninja -S . -B build --preset=${{ matrix.config.preset }}
278+
279+
# ==== BUILD ====
280+
- name: Build
281+
run: |
282+
buildcache -z
283+
cmake --build build --target osr-extract osr-backend osr-benchmark osr-test
284+
buildcache -s
285+
286+
# ==== TESTS ====
287+
- name: Run Tests
288+
if: ${{ !matrix.config.skiptests }}
289+
run: ${{ matrix.config.emulator }} build/osr-test
290+
291+
# ==== DISTRIBUTION ====
292+
- name: Create Distribution
293+
if: matrix.config.artifact
294+
run: |
295+
mkdir osr
296+
mv web osr/web
297+
mv build/osr-extract osr/osr-extract
298+
mv build/osr-backend osr/osr-backend
299+
tar cjf osr-${{ matrix.config.artifact }}.tar.bz2 osr
300+
301+
- name: Upload Distribution
302+
if: matrix.config.artifact
303+
uses: actions/upload-artifact@v4
304+
with:
305+
name: osr-${{ matrix.config.artifact }}
306+
path: osr-${{ matrix.config.artifact }}.tar.bz2
307+
308+
# ==== RELEASE ====
309+
- name: Upload Release
310+
if: github.event.action == 'published' && matrix.config.artifact
311+
uses: actions/upload-release-asset@v1.0.2
312+
env:
313+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
314+
with:
315+
upload_url: ${{ github.event.release.upload_url }}
316+
asset_path: ./osr-${{ matrix.config.artifact }}.tar.bz2
317+
asset_name: osr-${{ matrix.config.artifact }}.tar.bz2
318+
asset_content_type: application/x-tar

.pkg

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[boost]
2+
url=git@github.com:motis-project/boost.git
3+
branch=master
4+
commit=60cae66449fa3c9599b2b7d3d5d44c65301ed3a3
15
[osmium]
26
url=git@github.com:motis-project/libosmium.git
37
branch=master
@@ -33,7 +37,7 @@
3337
[tiles]
3438
url=git@github.com:motis-project/tiles.git
3539
branch=master
36-
commit=1b99290ba3ff16144afcdb04f6ca4e593d361c70
40+
commit=64f297ea0f782d04c89e82c6d478a1dd453e5f70
3741
[mimalloc]
3842
url=git@github.com:motis-project/mimalloc.git
3943
branch=master
@@ -57,7 +61,7 @@
5761
[expat]
5862
url=git@github.com:motis-project/expat.git
5963
branch=master
60-
commit=b8c26c40f1900899b95c795705e0252fc0c1350c
64+
commit=20b3b3e7dde39ee18c27c238b8d1246019ecb147
6165
[net]
6266
url=git@github.com:motis-project/net.git
6367
branch=master

.pkg.lock

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
15434619220611677274
1+
17387922825967387713
22
cista ebd5eb5cc7f82c414d3e060a3937d497189a103f
33
zlib d1c943390ba4f97aa2f50bedc629b6d29027fa0e
4-
boost be5235eb2258d2ec19e32546ab767a62311d9b46
4+
boost 60cae66449fa3c9599b2b7d3d5d44c65301ed3a3
55
conf a32d491bd54800310a53ccba13f4ee9f6736ff3e
6-
expat b8c26c40f1900899b95c795705e0252fc0c1350c
6+
expat 20b3b3e7dde39ee18c27c238b8d1246019ecb147
77
fmt edb385ac526c24bc917ec4a41bb0edb28f0ca59e
88
doctest 70e8f76437b76dd5e9c0a2eb9b907df190ab71a0
99
geo ee76668f0f0454e4acd3c769e00c6868620e3490
@@ -14,17 +14,16 @@ libressl 390253a44ceef00eb620c38606588414326e9f23
1414
net 44674d2f3917e20b7019a0f7254d332522c36fb7
1515
protozero 8c9f3fa97c2cfdceef86d0b61818ae98e9328f29
1616
rapidjson e7a1ac95c7840c6f4351abead02b1f7a02874197
17-
Catch2 47d56f28a9801911c048d011b375e5631dbb658f
18-
LuaJIT 4638e9198beb2f14bd1c90b42aff744469eed404
17+
LuaJIT babeae2c3311bed245ee86f3e35a1f244e3da60b
1918
clipper 904f0e6644c7f01c176443613be8f7788d59c658
2019
concurrentqueue 54fdce755d3e52c785d6d9d7d91c94615495868c
2120
lmdb 39d8127e5697b1323a67e61c3ad8f087384c7429
2221
miniz 1edbdece9d71dc65c6ff405572ee37cbdcef7af4
23-
res c500c261531a2b8b8d475fc9d42c075f28f72aaf
22+
res 7d97784ba785ce8a2677ea77164040fde484fb04
2423
pbf-sdf-fonts 91b369e4eb8a618e0a83b0c04b1b08632ea872c4
2524
sol2 fdb0f8a60e48aa737f0a8d73edede48627f0c984
2625
utl 4c1503afe58e209977d9a1e3db6a6b271a50c521
2726
variant 5aa73631dc969087c77433a5cdef246303051f69
28-
tiles 1b99290ba3ff16144afcdb04f6ca4e593d361c70
27+
tiles 64f297ea0f782d04c89e82c6d478a1dd453e5f70
2928
unordered_dense c11595a7743d20622637584bddf77243d72ae152
3029
rtree.c 6ed73a7dc4f1184f2b5b2acd8ac1c2b28a273057

0 commit comments

Comments
 (0)