-
Notifications
You must be signed in to change notification settings - Fork 62
113 lines (106 loc) · 5.11 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
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-12}, {name: clang, flag: --action_env=CC=clang-14}]
std: [{name: c++20}, {name: c++14, flag: --cxxopt=-std=c++14 --cxxopt=-faligned-new}]
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-latest
name: basic-${{matrix.compiler.name}}-${{matrix.std.name}}-${{matrix.stdlib.name}}-${{matrix.feature.name}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@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}}-
save-always: true
- run: bazel test --compilation_mode=opt --disk_cache=bazel-disk --verbose_failures --test_output=errors --test_verbose_timeout_warnings ${{matrix.compiler.flag}} ${{matrix.std.flag}} ${{matrix.stdlib.flag}} ${{matrix.feature.flag}} test/...
arenastring:
strategy:
matrix:
compiler: [{name: gcc, flag: --action_env=CC=gcc-12}, {name: clang, flag: --action_env=CC=clang-14}]
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-latest
name: arenastring-${{matrix.compiler.name}}-${{matrix.stdlib.name}}-${{matrix.mutable.name}}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@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}}-
save-always: true
- run: sed -i "/single_version_override.*protobuf/s/version = '[^']*'/version = '27.3.arenastring'/" MODULE.bazel
- run: bazel test --compilation_mode=opt --disk_cache=bazel-disk --verbose_failures --test_output=errors --test_verbose_timeout_warnings --config=asan ${{matrix.compiler.flag}} ${{matrix.stdlib.flag}} ${{matrix.mutable.flag}} test/...
aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: bazel-disk
key: bazel-disk-aarch64-${{github.sha}}
restore-keys: bazel-disk-aarch64-
save-always: true
- run: sudo apt update
- run: sudo apt install g++-12-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 --test_verbose_timeout_warnings --platforms='@cross_config_toolchain//:cross' --action_env=CROSS_CC=/usr/bin/aarch64-linux-gnu-gcc-12 --features=-default_link_flags --test_env=LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib -- test/... -test/logging:test_log_statically
workspace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: bazel-disk
key: bazel-disk-workspace-${{github.sha}}
restore-keys: bazel-disk-workspace-
save-always: true
- run: bazel test --disk_cache=bazel-disk --verbose_failures --test_output=errors --test_verbose_timeout_warnings --enable_bzlmod=false test/...
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: bazel-disk
key: bazel-disk-coverage-${{github.sha}}
restore-keys: bazel-disk-coverage-
save-always: true
- run: bazel coverage --disk_cache=bazel-disk --verbose_failures --test_output=errors --test_verbose_timeout_warnings --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
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)