Add fuchsia_builder_group as top-level target
This target requires the local sdk-integration patch to include the
commit from https://fuchsia-review.git.corp.google.com/c/sdk-integration/+/772762
to avoid visibility errors.
BUG: 113019
Change-Id: Ice52fe12b15dc40ca638e4b26e539fe4d4bf76e2
Reviewed-on: https://fuchsia-review.googlesource.com/c/sdk-samples/getting-started/+/786662
Reviewed-by: Renato Mangini Dias <mangini@google.com>
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..30f121f
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,21 @@
+# Copyright 2023 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+load(
+ "@fuchsia_infra//infra:infra.bzl",
+ "fuchsia_builder_group",
+)
+
+# This is the top level target that gets built by infra
+fuchsia_builder_group(
+ name = "buildbot",
+ build_only = [
+ # TODO(fxbug.dev/118847) Remove the extra aggregate target in favor
+ # of listing the build only targets here.
+ "//src:fuchsia_samples",
+ ],
+ test_groups = [
+ "//src:tests",
+ ],
+)
diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel
index dfbb1cf..5998a51 100644
--- a/WORKSPACE.bazel
+++ b/WORKSPACE.bazel
@@ -22,6 +22,11 @@
versions.check(minimum_bazel_version = "5.1.0")
local_repository(
+ name = "fuchsia_infra",
+ path = "third_party/fuchsia-infra-bazel-rules",
+)
+
+local_repository(
name = "rules_fuchsia",
path = "third_party/sdk-integration/bazel_rules_fuchsia",
)
@@ -47,6 +52,7 @@
)
load("@fuchsia_clang//:defs.bzl", "register_clang_toolchains")
+
register_clang_toolchains()
# gTest.
diff --git a/src/BUILD.bazel b/src/BUILD.bazel
index 079cb51..efa230a 100644
--- a/src/BUILD.bazel
+++ b/src/BUILD.bazel
@@ -6,18 +6,44 @@
"@rules_fuchsia//fuchsia:defs.bzl",
"fuchsia_package_group",
)
+load(
+ "@fuchsia_infra//infra:infra.bzl",
+ "fuchsia_test_group",
+ "fuchsia_tests",
+)
fuchsia_package_group(
name = "fuchsia_samples",
testonly = True,
-
+ visibility = ["//:__pkg__"],
deps = [
"//src/echo:pkg",
"//src/echo:test_pkg",
"//src/hello_world:pkg",
"//src/hello_world:test_pkg",
+ "//src/routing:inspect_pkg",
"//src/routing:pkg",
+ "//src/routing/integration_tests:test_pkg",
+ ],
+)
+
+fuchsia_test_group(
+ name = "target_tests",
+ product_bundle = "workstation_eng.qemu-x64",
+ deps = [
+ "//src/echo:test_pkg",
+ "//src/hello_world:test_pkg",
"//src/routing:inspect_pkg",
"//src/routing/integration_tests:test_pkg",
],
)
+
+fuchsia_tests(
+ name = "tests",
+ visibility = [
+ "//:__pkg__",
+ ],
+ deps = [
+ ":target_tests",
+ ],
+)