Skip to content

Commit 65133a7

Browse files
Fix bazel build errors with clang and enable bazel CI (#177)
* Enable bzlmod * Fix asan bazel build and enable CI --------- Signed-off-by: Shameek Ganguly <shameek@intrinsic.ai>
1 parent 4a2b05a commit 65133a7

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

.github/workflows/bazel.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Bazel CI
2+
on:
3+
push:
4+
branches: [gz-plugin3, main]
5+
pull_request:
6+
branches: [gz-plugin3, main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7
15+
with:
16+
folders: |
17+
[
18+
".",
19+
]
20+
exclude: |
21+
[
22+
{"folder": ".", "bzlmodEnabled": false},
23+
]

.github/workflows/ci.bazelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file contains Bazel settings to apply on CI only.
2+
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml
3+
4+
# Debug where options came from
5+
build --announce_rc
6+
# This directory is configured in GitHub actions to be persisted between runs.
7+
# We do not enable the repository cache to cache downloaded external artifacts
8+
# as these are generally faster to download again than to fetch them from the
9+
# GitHub actions cache.
10+
build --disk_cache=~/.cache/bazel
11+
# Don't rely on test logs being easily accessible from the test runner,
12+
# though it makes the log noisier.
13+
test --test_output=errors
14+
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
15+
test --test_env=XDG_CACHE_HOME

BUILD.bazel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cc_library(
5252
includes = ["core/include"],
5353
visibility = ["//visibility:public"],
5454
deps = [
55-
"@gz-utils",
55+
"@gz-utils//:SuppressWarning",
5656
],
5757
)
5858

@@ -61,6 +61,7 @@ cc_library(
6161
srcs = [src],
6262
deps = [
6363
":core",
64+
"@googletest//:gtest",
6465
"@googletest//:gtest_main",
6566
],
6667
) for src in glob(
@@ -114,7 +115,7 @@ cc_library(
114115
visibility = ["//visibility:public"],
115116
deps = [
116117
":core",
117-
"@gz-utils",
118+
"@gz-utils//:SuppressWarning",
118119
],
119120
)
120121

@@ -130,6 +131,7 @@ cc_test(
130131
":core",
131132
":loader",
132133
"//test:test_plugins",
134+
"@googletest//:gtest",
133135
"@googletest//:gtest_main",
134136
],
135137
)

test/BUILD.bazel

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cc_binary(
2828
linkshared = 1,
2929
deps = [
3030
":test_plugins_core",
31+
"//:core",
3132
"//:register",
3233
],
3334
)
@@ -41,6 +42,7 @@ cc_binary(
4142
linkshared = 1,
4243
deps = [
4344
":test_plugins_core",
45+
"//:core",
4446
"//:register",
4547
],
4648
)
@@ -54,6 +56,7 @@ cc_binary(
5456
linkshared = 1,
5557
deps = [
5658
":test_plugins_core",
59+
"//:core",
5760
"//:register",
5861
],
5962
)
@@ -67,6 +70,7 @@ cc_binary(
6770
linkshared = 1,
6871
deps = [
6972
":test_plugins_core",
73+
"//:core",
7074
"//:register",
7175
],
7276
)
@@ -80,6 +84,7 @@ cc_binary(
8084
linkshared = 1,
8185
deps = [
8286
":test_plugins_core",
87+
"//:core",
8388
"//:register",
8489
],
8590
)
@@ -158,7 +163,9 @@ cc_test(
158163
srcs = ["integration/aliases.cc"],
159164
deps = [
160165
":test_plugins",
166+
":test_plugins_core",
161167
"//:loader",
168+
"@googletest//:gtest",
162169
"@googletest//:gtest_main",
163170
],
164171
)
@@ -171,7 +178,10 @@ cc_test(
171178
],
172179
deps = [
173180
":test_plugins",
181+
":test_plugins_core",
182+
"//:core",
174183
"//:loader",
184+
"@googletest//:gtest",
175185
"@googletest//:gtest_main",
176186
],
177187
)
@@ -184,7 +194,10 @@ cc_test(
184194
],
185195
deps = [
186196
":test_plugins",
197+
":test_plugins_core",
198+
"//:core",
187199
"//:loader",
200+
"@googletest//:gtest",
188201
"@googletest//:gtest_main",
189202
],
190203
)
@@ -197,7 +210,10 @@ cc_test(
197210
],
198211
deps = [
199212
":test_plugins",
213+
":test_plugins_core",
214+
"//:core",
200215
"//:loader",
216+
"@googletest//:gtest",
201217
"@googletest//:gtest_main",
202218
],
203219
)
@@ -210,7 +226,10 @@ cc_test(
210226
],
211227
deps = [
212228
":test_plugins",
229+
":test_plugins_core",
230+
"//:core",
213231
"//:loader",
232+
"@googletest//:gtest",
214233
"@googletest//:gtest_main",
215234
],
216235
)
@@ -223,7 +242,10 @@ cc_test(
223242
],
224243
deps = [
225244
":test_plugins",
245+
":test_plugins_core",
246+
"//:core",
226247
"//:loader",
248+
"@googletest//:gtest",
227249
"@googletest//:gtest_main",
228250
],
229251
)

0 commit comments

Comments
 (0)