Skip to content

Commit

Permalink
Switch BCR presubmit to testing from example module (instead of defau…
Browse files Browse the repository at this point in the history
…lt dummy module) so we can use .bazelrc and reference @local_config_cc.

PiperOrigin-RevId: 727029136
  • Loading branch information
zhangskz committed Feb 14, 2025
1 parent c07e854 commit 8171744
Showing 1 changed file with 13 additions and 59 deletions.
72 changes: 13 additions & 59 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,20 @@
matrix:
platform: ["debian10", "macos", "ubuntu2004"]
bazel: [7.x]

tasks:
verify_targets:
name: "Verify build targets"
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--host_cxxopt=-std=c++17'
- '--cxxopt=-std=c++17'
build_targets:
- '@protobuf//:protobuf'
- '@protobuf//:protobuf_lite'
- '@protobuf//:protobuf_python'
- '@protobuf//:protobuf_java'
- '@protobuf//:protoc'
- '@protobuf//:test_messages_proto2_cc_proto'
- '@protobuf//:test_messages_proto3_cc_proto'
# Separate windows for different c++ build flags.
verify_targets_windows:
name: "Verify windows build targets"
platform: windows
bazel: ${{ bazel }}
build_flags:
- '--cxxopt=/std:c++17'
- '--host_cxxopt=/std:c++17'
# Run using clang-cl
- '--extra_execution_platforms=@protobuf//build_defs:x64_windows-clang-cl'
- '--host_platform=@protobuf//build_defs:x64_windows-clang-cl'
- '--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl'
build_targets:
- '@protobuf//:protobuf'
- '@protobuf//:protobuf_lite'
- '@protobuf//:protobuf_python'
- '@protobuf//:protobuf_java'
- '@protobuf//:protoc'
- '@protobuf//:test_messages_proto2_cc_proto'
- '@protobuf//:test_messages_proto3_cc_proto'

bcr_test_module:
module_path: "examples"
module_path: examples
matrix:
platform: ["debian10", "macos", "ubuntu2004"]
platform: ["debian10", "macos", "ubuntu2004", "windows"]
bazel: [7.x]

tasks:
run_test_module:
name: "Run test module"
verify_targets:
name: "Verify build targets"
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--host_cxxopt=-std=c++17'
- '--cxxopt=-std=c++17'
build_targets:
- "//..."
# Separate windows for different c++ build flags.
run_test_module_windows:
name: "Run windows test module"
platform: windows
bazel: ${{ bazel }}
build_flags:
- '--cxxopt=/std:c++17'
- '--host_cxxopt=/std:c++17'
build_targets:
- "//..."
- '//...'
- '@com_google_protobuf//:protobuf'
- '@com_google_protobuf//:protobuf_lite'
- '@com_google_protobuf//:protobuf_python'
- '@com_google_protobuf//:protobuf_java'
- '@com_google_protobuf//:protoc'
- '@com_google_protobuf//:test_messages_proto2_cc_proto'
- '@com_google_protobuf//:test_messages_proto3_cc_proto'

0 comments on commit 8171744

Please sign in to comment.