feat: test bzlmod usage on CI (#16319)
Closes #16319
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16319 from protocolbuffers:bcr d66845cfcb
PiperOrigin-RevId: 619939078
pull/16280/head
parent
62620979c2
commit
71e4061ace
9 changed files with 82 additions and 2 deletions
@ -0,0 +1,23 @@ |
||||
name: Bazel |
||||
|
||||
# Controls when the action will run. |
||||
on: |
||||
# Triggers the workflow on push or pull request events but only for the main branch |
||||
push: |
||||
branches: [main] |
||||
pull_request: |
||||
branches: [main] |
||||
# Allows you to run this workflow manually from the Actions tab |
||||
workflow_dispatch: |
||||
|
||||
concurrency: |
||||
# Cancel previous actions from the same PR or branch except 'main' branch. |
||||
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info. |
||||
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}} |
||||
cancel-in-progress: ${{ github.ref_name != 'main' }} |
||||
|
||||
jobs: |
||||
test: |
||||
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v6 |
||||
with: |
||||
folders: '["examples"]' |
@ -1,2 +1,23 @@ |
||||
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel |
||||
# https://github.com/protocolbuffers/protobuf/issues/14313 |
||||
module( |
||||
name = "protobuf", |
||||
compatibility_level = 1, |
||||
version = "27.0", |
||||
) |
||||
|
||||
# LOWER BOUND dependency versions. |
||||
# Bzlmod follows MVS: |
||||
# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution |
||||
# Thus the highest version in their module graph is resolved. |
||||
bazel_dep(name = "abseil-cpp", repo_name = "com_google_absl", version = "20230802.0.bcr.1") |
||||
bazel_dep(name = "bazel_skylib", version = "1.4.1") |
||||
bazel_dep(name = "jsoncpp", version = "1.9.5") |
||||
bazel_dep(name = "rules_cc", version = "0.0.9") |
||||
bazel_dep(name = "rules_java", version = "4.0.0") |
||||
bazel_dep(name = "rules_jvm_external", version = "5.1") |
||||
bazel_dep(name = "rules_pkg", version = "0.7.0") |
||||
bazel_dep(name = "rules_proto", version = "4.0.0") |
||||
bazel_dep(name = "rules_python", version = "0.10.2") |
||||
bazel_dep(name = "platforms", version = "0.0.8") |
||||
bazel_dep(name = "zlib", version = "1.2.11") |
||||
|
@ -0,0 +1 @@ |
||||
7.1.0 |
@ -0,0 +1,13 @@ |
||||
"""Bazel module dependencies""" |
||||
bazel_dep(name = "protobuf", version = "0.0.0", dev_dependency = True, repo_name = "com_google_protobuf") |
||||
|
||||
local_path_override( |
||||
module_name = "protobuf", |
||||
path = "..", |
||||
) |
||||
|
||||
bazel_dep(name = "bazel_skylib", version = "1.0.3") |
||||
bazel_dep(name = "rules_cc", version = "0.0.1") |
||||
bazel_dep(name = "rules_java", version = "7.3.0") |
||||
bazel_dep(name = "rules_pkg", version = "0.7.0") |
||||
bazel_dep(name = "rules_proto", version = "4.0.0") |
@ -0,0 +1 @@ |
||||
# This file shadows WORKSPACE in builds with `--enable_bzlmod` |
Loading…
Reference in new issue