-
Notifications
You must be signed in to change notification settings - Fork 67
177 lines (168 loc) · 7.64 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
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
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}]
mode: [{name: dbg, flag: --compilation_mode=dbg}, {name: opt, flag: --compilation_mode=opt}]
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: --features=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.mode.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.mode.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-${{github.sha}}
restore-keys: bazel-disk-basic-${{matrix.compiler.name}}-${{matrix.mode.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-
- if: ${{matrix.stdlib.name == 'libc++'}}
run: sudo apt install libc++-18-dev libc++abi-18-dev
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors ${{matrix.compiler.flag}} ${{matrix.mode.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.mode.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}-${{github.sha}}
compatible:
strategy:
fail-fast: false
matrix:
compiler: [{name: gcc-9, flag: --action_env=CC=gcc-9}]
runs-on: ubuntu-20.04
name: compatible-${{matrix.compiler.name}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: bazel-disk
key: bazel-disk-compatible-${{matrix.compiler.name}}-${{github.sha}}
restore-keys: bazel-disk-compatible-${{matrix.compiler.name}}
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors ${{matrix.compiler.flag}} test/...
- uses: actions/cache/save@v4
if: always()
with:
path: bazel-disk
key: bazel-disk-compatible-${{matrix.compiler.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}}-
- if: ${{matrix.stdlib.name == 'libc++'}}
run: sudo apt install libc++-18-dev libc++abi-18-dev
- run: sed -i "/single_version_override.*protobuf/s/version = '[^']*'/version = '28.3.arenastring'/" MODULE.bazel
- run: bazel test --compilation_mode=opt --disk_cache=bazel-disk --verbose_failures --test_output=errors --features=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-24.04
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: sed -i "/single_version_override.*protobuf/s/version = '[^']*'/version = '27.5'/" MODULE.bazel
- 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 -DBUILD_TESTING=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)