Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CI by running both WORKSPACE and Bzlmod on select packages #1690

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 74 additions & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ matrix:

tasks:
ubuntu2204:
name: Ubuntu 22.04 with WORKSPACE
platform: ubuntu2204
build_flags:
- "--noexperimental_enable_bzlmod"
test_flags:
- "--noexperimental_enable_bzlmod"
build_targets:
- "..."
run_targets:
Expand All @@ -15,6 +20,19 @@ tasks:
- "//:gazelle_ci"
test_targets:
- "..."
ubuntu2204_bzlmod:
name: Ubuntu 22.04 with Bzlmod
platform: ubuntu2204
build_targets:
- "..."
run_targets:
# Run Gazelle on repo to verify BUILD files are up-to-date. The output shouldn't differ
# between platforms, so we only run it from one.
- "//:gazelle_ci"
test_targets:
- "..."
- "-//internal:bazel_test"
- "-//cmd/gazelle:gazelle_test"
bcr_tests:
name: BCR test module
platform: ${{ platform }}
Expand Down Expand Up @@ -58,20 +76,75 @@ tasks:
- "//pkg:pkg_test"
- "//..."
- "@test_dep//..."
macos_arm64_bzlmod:
name: Mac OS Arm 64 with Bzlmod
platform: macos_arm64
build_targets:
- "..."
test_targets:
- "..."
- "-//internal:bazel_test"
- "-//cmd/gazelle:gazelle_test"
macos_arm64:
name: Mac OS Arm 64 with WORKSPACE
platform: macos_arm64
build_flags:
- "--noexperimental_enable_bzlmod"
test_flags:
- "--noexperimental_enable_bzlmod"
build_targets:
- "..."
test_targets:
- "..."
macos:
macos_bzlmod:
name: Mac OS with Bzlmod
platform: macos
build_targets:
- "..."
test_targets:
- "..."
- "-//internal:bazel_test"
- "-//cmd/gazelle:gazelle_test"
macos:
name: Mac OS with WORKSPACE
build_flags:
- "--noexperimental_enable_bzlmod"
test_flags:
- "--noexperimental_enable_bzlmod"
build_targets:
- "..."
test_targets:
- "..."
windows_bzlmod:
name: Windows with Bzlmod
platform: windows
build_targets:
- "--"
- "..."
- "-//cmd/autogazelle/..."
test_targets:
- "--"
- "..."
- "-//cmd/gazelle:gazelle_test"
# autogazelle is only supported on UNIX-like platforms.
# It requires UNIX domain sockets.
- "-//cmd/autogazelle/..."
# Stardoc produces different line-endings on windows,
# so the documentation it generates doesn't match the checked in files
- "-//docs:all"
# Fails to execute, apparently due to command-line length limit.
- "-//internal:bazel_test"
# gazelle prints file paths with backward slashes on windows,
# which doesn't match the golden files generated on *nix.
- "-//tests:fix_mode_print0"
- "-//tests:fix_mode_strict"
windows:
name: Windows with WORKSPACE
platform: windows
build_flags:
- "--noexperimental_enable_bzlmod"
test_flags:
- "--noexperimental_enable_bzlmod"
build_targets:
- "--"
- "..."
Expand Down
13 changes: 11 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module(
repo_name = "bazel_gazelle",
)

bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "protobuf", version = "3.19.6", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.42.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_proto", version = "4.0.0")
Expand Down Expand Up @@ -54,4 +54,13 @@ use_repo(
)

bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.5.1", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")


go_sdk_dev = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk", dev_dependency = True)

# Known to exist since it is instantiated by rules_go itself.
use_repo(
go_sdk_dev,
go_sdk = "go_default_sdk",
)
Loading