-
Notifications
You must be signed in to change notification settings - Fork 62
152 lines (144 loc) · 6.5 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
basic:
strategy:
fail-fast: false
matrix:
compiler: [{name: gcc, flag: --action_env=CC=gcc-14}, {name: clang, flag: --action_env=CC=clang-18}]
std: [{name: c++20, flag: --cxxopt=-std=c++20}, {name: c++14, flag: --cxxopt=-std=c++14}]
stdlib: [{name: stdlibc++}, {name: libc++, flag: --cxxopt=-stdlib=libc++ --linkopt=-stdlib=libc++}]
feature: [{name: asan, flag: --config=asan}, {name: tsan, flag: --features=tsan}]
exclude:
- compiler: {name: gcc}
stdlib: {name: libc++}
- std: {name: c++14}
feature: {name: tsan}
runs-on: ubuntu-24.04
name: basic-${{matrix.compiler.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-basic-${{matrix.compiler.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-${{github.sha}}
restore-keys: bazel-disk-basic-${{matrix.compiler.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-
- run: sudo apt install libc++-18-dev libc++abi-18-dev
- run: bazel test --compilation_mode=dbg --disk_cache=bazel-disk --verbose_failures --test_output=errors ${{matrix.compiler.flag}} ${{matrix.std.flag}} ${{matrix.stdlib.flag}} ${{matrix.feature.flag}} test/...
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-basic-${{matrix.compiler.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-${{github.sha}}
arenastring:
strategy:
fail-fast: false
matrix:
compiler: [{name: gcc, flag: --action_env=CC=gcc-14}, {name: clang, flag: --action_env=CC=clang-18}]
stdlib: [{name: stdlibc++}, {name: libc++, flag: --cxxopt=-stdlib=libc++ --linkopt=-stdlib=libc++}]
mutable: [{name: default}, {name: half, flag: --config=arenastring}, {name: full, flag: --config=mutable-donated-string}]
exclude:
- compiler: {name: gcc}
stdlib: {name: libc++}
- compiler: {name: clang}
mutable: {name: half}
- compiler: {name: clang}
mutable: {name: full}
runs-on: ubuntu-24.04
name: arenastring-${{matrix.compiler.name}}-${{matrix.stdlib.name}}-${{matrix.mutable.name}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-arenastring-${{matrix.compiler.name}}-${{matrix.stdlib.name}}-${{matrix.mutable.name}}-${{github.sha}}
restore-keys: bazel-disk-arenastring-${{matrix.compiler.name}}-${{matrix.stdlib.name}}-${{matrix.mutable.name}}-
- run: sudo apt install libc++-18-dev libc++abi-18-dev
- run: sed -i "/single_version_override.*protobuf/s/version = '[^']*'/version = '27.5.arenastring'/" MODULE.bazel
- run: bazel test --compilation_mode=opt --disk_cache=bazel-disk --verbose_failures --test_output=errors --config=asan --registry=https://bcr.bazel.build --registry=file://%workspace%/registry ${{matrix.compiler.flag}} ${{matrix.stdlib.flag}} ${{matrix.mutable.flag}} test/...
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-arenastring-${{matrix.compiler.name}}-${{matrix.stdlib.name}}-${{matrix.mutable.name}}-${{github.sha}}
cpp14-coroutine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-c++14-coroutine-${{github.sha}}
restore-keys: bazel-disk-c++14-coroutine-
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors --action_env=CC=gcc-12 --cxxopt=-std=c++14 --cxxopt=-fcoroutines --cxxopt=-fconcepts test/...
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-c++14-coroutine-${{github.sha}}
aarch64:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-aarch64-${{github.sha}}
restore-keys: bazel-disk-aarch64-
- run: sudo apt update
- run: sudo apt install g++-14-aarch64-linux-gnu
- run: sudo apt install qemu-user
- run: sudo ln -s /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors --platforms='@cross_config_toolchain//:cross' --action_env=CROSS_CC=/usr/bin/aarch64-linux-gnu-gcc-14 --features=-default_link_flags --test_env=LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib -- test/... -test/logging:test_log_statically
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-aarch64-${{github.sha}}
workspace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-workspace-${{github.sha}}
restore-keys: bazel-disk-workspace-
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors --enable_bzlmod=false test/...
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-workspace-${{github.sha}}
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-coverage-${{github.sha}}
restore-keys: bazel-disk-coverage-
- run: bazel coverage --disk_cache=bazel-disk --verbose_failures --test_output=errors --combined_report=lcov --instrumentation_filter='src/babylon,-src/babylon/reusable/patch' test/...
- run: .github/workflows/filter_lcov.sh
- uses: coverallsapp/github-action@v2
with:
github-token: ${{github.token}}
file: bazel-out/_coverage/_coverage_report.lcov
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-coverage-${{github.sha}}
cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hendrikmuhs/[email protected]
- run: cmake -Bbuild -DBUILD_DEPS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- run: cmake --build build --parallel $(nproc)
- run: ctest --test-dir build --output-on-failure --parallel $(nproc)