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

Improve CI setup: add tests for Bazel 5.x and 6.x (with and without bzlmod); use Ubuntu 20.04 as main platform #500

Merged
merged 3 commits into from
Apr 25, 2024
Merged
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
198 changes: 93 additions & 105 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,142 +1,130 @@
---
matrix:
platform:
- ubuntu1804
- ubuntu2004
- macos

.reusable_build_flags: &reusable_build_flags
? "--incompatible_config_setting_private_default_visibility"
? "--incompatible_disallow_empty_glob"

.reusable_test_flags: &reusable_test_flags
<<: *reusable_build_flags
? "--test_env=PATH"

.reusable_targets: &reusable_targets
? "--"
? "//..."
? "@bazel_skylib_gazelle_plugin//..."

.reusable_config: &reusable_config
build_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
test_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
build_flags: *reusable_build_flags
test_flags: *reusable_test_flags
build_targets: *reusable_targets
test_targets: *reusable_targets

tasks:
ubuntu1804_latest:
ubuntu2004_bazel5:
<<: *reusable_config
name: "Latest Bazel"
platform: ubuntu1804
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--test_env=PATH"
name: "Bazel 5.x"
platform: ubuntu2004
bazel: 5.x

ubuntu1604_latest:
name: "Latest Bazel"
platform: ubuntu1604
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
ubuntu2004_bazel6:
<<: *reusable_config
name: "Bazel 6.x"
platform: ubuntu2004
bazel: 6.x
build_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
test_flags:
- "--test_env=PATH"
<<: *reusable_targets
# rules_pkg fails with --noenable_bzlmod
? "-//distribution/..."
test_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
<<: *reusable_targets
# rules_pkg fails with --noenable_bzlmod
? "-//distribution/..."

macos_latest:
ubuntu2004_bazel6_enable_bzlmod:
<<: *reusable_config
name: "Latest Bazel"
platform: macos
bazel: latest
name: "Bazel 6.x with --enable_bzlmod"
platform: ubuntu2004
bazel: 6.x
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
<<: *reusable_build_flags
? "--enable_bzlmod"
test_flags:
- "--test_env=PATH"
<<: *reusable_test_flags
? "--enable_bzlmod"

windows_latest:
latest:
<<: *reusable_config
name: "Latest Bazel"
platform: windows
platform: ${{ platform }}
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
# https://github.com/bazelbuild/bazel/issues/7761 is fixed
- "--test_env=LOCALAPPDATA"
- "--test_tag_filters=-no_windows"

ubuntu1804_last_green:
ubuntu2004_latest_noenable_bzlmod:
<<: *reusable_config
name: "Last Green Bazel"
platform: ubuntu1804
bazel: last_green
name: "Latest Bazel with --noenable_bzlmod"
platform: ubuntu2004
bazel: latest
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
<<: *reusable_build_flags
? "--noenable_bzlmod"
test_flags:
- "--test_env=PATH"
<<: *reusable_test_flags
? "--noenable_bzlmod"
build_targets:
<<: *reusable_targets
# rules_pkg fails with --noenable_bzlmod
? "-//distribution/..."
test_targets:
<<: *reusable_targets
# rules_pkg fails with --noenable_bzlmod
? "-//distribution/..."

ubuntu1604_last_green:
name: "Last Green Bazel"
ubuntu1604_latest:
<<: *reusable_config
name: "Latest Bazel"
platform: ubuntu1604
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
bazel: latest
build_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
test_flags:
- "--test_env=PATH"
<<: *reusable_targets
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
? "-//distribution/..."
test_targets:
- "--"
- "//..."
- "@bazel_skylib_gazelle_plugin//..."
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
- "-//distribution/..."
<<: *reusable_targets
# //distribution requires Python >= 3.6 for some rules_pkg scripts; Ubuntu 16.04 has Python 3.5
? "-//distribution/..."

macos_last_green:
windows_latest:
<<: *reusable_config
name: "Last Green Bazel"
platform: macos
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
name: "Latest Bazel"
platform: windows
bazel: latest
test_flags:
- "--test_env=PATH"
<<: *reusable_test_flags
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
# https://github.com/bazelbuild/bazel/issues/7761 is fixed
? "--test_env=LOCALAPPDATA"
? "--test_tag_filters=-no_windows"

windows_last_green:
last_green:
<<: *reusable_config
name: "Last Green Bazel"
platform: windows
platform: ${{ platform }}
bazel: last_green
build_flags:
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
# https://github.com/bazelbuild/bazel/issues/7761 is fixed
- "--test_env=LOCALAPPDATA"
- "--test_tag_filters=-no_windows"

ubuntu1804_last_green_bzlmod:
windows_last_green:
<<: *reusable_config
name: "Last Green Bazel (with bzlmod)"
platform: ubuntu1804
name: "Last Green Bazel"
platform: windows
bazel: last_green
build_flags:
- "--enable_bzlmod"
- "--incompatible_config_setting_private_default_visibility"
- "--incompatible_disallow_empty_glob"
test_flags:
- "--enable_bzlmod"
- "--test_env=PATH"
<<: *reusable_test_flags
# TODO(laszlocsomor): remove "--test_env=LOCALAPPDATA" after
# https://github.com/bazelbuild/bazel/issues/7761 is fixed
? "--test_env=LOCALAPPDATA"
? "--test_tag_filters=-no_windows"

buildifier: latest