From 4359934845c7af3f3d42fb695ee97bfb2f36cf9e Mon Sep 17 00:00:00 2001 From: Simon Stewart Date: Fri, 14 Apr 2023 14:55:57 +0100 Subject: [PATCH] Amend release workflow now we have bzlmod in the mix (#174) --- .github/workflows/ci.yaml | 11 +++++++++-- docs/BUILD.bazel | 8 ++++++++ repositories.bzl | 8 ++++++++ tools/BUILD.bazel | 4 ++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bc1dba8f..31ec1f07 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,10 +38,17 @@ jobs: env: # Bazelisk will download bazel to here, ensure it is cached between runs. XDG_CACHE_HOME: ~/.cache/bazel-repo - run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --config=jdk11 //... -- -//docs/... -//tools:update-docs + run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --config=jdk11 //... - name: bazel test //... (Java 17) env: # Bazelisk will download bazel to here, ensure it is cached between runs. XDG_CACHE_HOME: ~/.cache/bazel-repo - run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... -- -//docs/... -//tools:update-docs + run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... + + - name: bazel test //... (no bzlmod) + env: + # Bazelisk will download bazel to here, ensure it is cached between runs. + XDG_CACHE_HOME: ~/.cache/bazel-repo + # The docs targets are tagged as `manual` to prevent stardoc from running with bzlmod + run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --noenable_bzlmod //... //docs:all diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index d4481cac..9005f16d 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -5,6 +5,10 @@ stardoc( name = "java-docs", out = "java-docs.md", input = "stardoc-input.bzl", + tags = [ + # Stardoc doesn't work with bzlmod + "manual", + ], deps = [ "//java:defs", ], @@ -19,6 +23,10 @@ genrule( ], outs = ["README.md"], cmd = """cat $(location preamble.md) $(location :java-docs) $(location postfix.md) >$@""", + tags = [ + # Stardoc doesn't work with bzlmod + "manual", + ], visibility = ["//tools:__pkg__"], ) diff --git a/repositories.bzl b/repositories.bzl index bed9f6a0..5b549c75 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -25,6 +25,14 @@ def contrib_rules_jvm_deps(): url = "https://github.com/bazelbuild/bazel-skylib/archive/1.3.0.tar.gz", ) + maybe( + http_archive, + name = "bazel_skylib_gazelle_plugin", + sha256 = "3b620033ca48fcd6f5ef2ac85e0f6ec5639605fa2f627968490e52fc91a9932f", + strip_prefix = "bazel-skylib-1.3.0/gazelle", + url = "https://github.com/bazelbuild/bazel-skylib/archive/1.3.0.tar.gz", + ) + maybe( http_archive, name = "com_google_protobuf", diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel index 30d479eb..7824adfb 100644 --- a/tools/BUILD.bazel +++ b/tools/BUILD.bazel @@ -37,4 +37,8 @@ sh_binary( data = [ "//docs:readme", ], + tags = [ + # Stardoc does not play nicely with bzlmod + "manual", + ], )