Skip to content

Commit

Permalink
Enable opt and asan Rust GHA tests, and split out the Cargo test to m…
Browse files Browse the repository at this point in the history
…ake those failures present more cleanly in GHA (the Cargo test was already using a different docker image than the other tests).

Have the spot for enabling a bzlmod test, currently commented out with a TODO because it would be broken at head.

PiperOrigin-RevId: 698842317
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Nov 21, 2024
1 parent c2394d9 commit 2dde8f1
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,27 @@ permissions:
jobs:
# This job should be run on presubmit, if any continuous-only tests are added we will need to input test-type above
linux:
name: Linux
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
config:
- { name: "No bzlmod", flags: --noenable_bzlmod }
# TODO: b/379846319 - Fix the tests with bzlmod and enable this.
# - { name: "bzlmod", flags: --enable_bzlmod --enable_workspace }
- { name: Optimized, flags: --config=opt }
- { name: ASAN, flags: --config=asan }

include:
- targets: "//rust/... //src/google/protobuf/compiler/rust/..."
- image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-97f82260fd504923d8af642d567afb2d83a1959d"
- bazel_cmd: "test"

# Override cases with custom images
- config: { name: Cargo }
image: "us-docker.pkg.dev/protobuf-build/containers/release/linux/rust:6.3.0-1.74.0-8858126dd9480abf91e6ce8d6e41a5cd3c03882c"
bazel_cmd: "run"
targets: "//rust:cargo_test"
name: Linux ${{ matrix.config.name }}
runs-on: ubuntu-22-4core
steps:
- name: Checkout pending changes
Expand All @@ -24,18 +44,10 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.1-97f82260fd504923d8af642d567afb2d83a1959d"
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: rust_linux
bazel: >-
test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --@rules_rust//rust/settings:experimental_use_cc_common_link=True
//rust/...
//src/google/protobuf/compiler/rust/...
- name: Run Cargo tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: "us-docker.pkg.dev/protobuf-build/containers/release/linux/rust:6.3.0-1.74.0-8858126dd9480abf91e6ce8d6e41a5cd3c03882c"
image: ${{ matrix.image }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: rust_linux
bazel: >-
run --crosstool_top=//toolchain:clang_suite --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //rust:cargo_test
${{ matrix.bazel_cmd }} --crosstool_top=//toolchain:clang_suite --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --@rules_rust//rust/settings:experimental_use_cc_common_link=True
${{ matrix.targets }} ${{ matrix.config.flags }}

0 comments on commit 2dde8f1

Please sign in to comment.