Run C# tests with non-Bazel protobuf-ci actions.

The Bazel action currently isn't setup to regenerate the proto gencode itself, meaning that it won't actually be running on changes in the pending PR.  Long-term, we should migrate this back to Bazel after enabling proto codegen properly.

PiperOrigin-RevId: 611238217
pull/16000/head
Mike Kruskal 9 months ago committed by Copybara-Service
parent 37c1e2e662
commit 119e71c40a
  1. 39
      .github/workflows/test_csharp.yml

@ -20,13 +20,31 @@ jobs:
uses: protocolbuffers/protobuf-ci/checkout@v2 uses: protocolbuffers/protobuf-ci/checkout@v2
with: with:
ref: ${{ inputs.safe-checkout }} ref: ${{ inputs.safe-checkout }}
# TODO Run this with Bazel once codegen is handled properly.
- name: Run tests - name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v2
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/csharp:3.1.415-6.0.100-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
entrypoint: /bin/bash
command: >-
-c "
cd csharp &&
dotnet restore src/Google.Protobuf.sln &&
dotnet build -c Release src/Google.Protobuf.sln &&
dotnet test -c Release -f net6.0 src/Google.Protobuf.Test/Google.Protobuf.Test.csproj"
- name: Clear bazel between docker instances
run: sudo rm -rf _build
- name: Run conformance tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v2 uses: protocolbuffers/protobuf-ci/bazel-docker@v2
with: with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/csharp:3.1.415-6.0.100-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea image: us-docker.pkg.dev/protobuf-build/containers/test/linux/csharp:3.1.415-6.0.100-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: csharp_linux bazel-cache: csharp_linux
bazel: test //csharp/... --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=/home/bazel bazel: test //csharp:conformance_test --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=/home/bazel
windows: windows:
name: Windows name: Windows
@ -42,11 +60,22 @@ jobs:
with: with:
dotnet-version: '6.0.x' dotnet-version: '6.0.x'
- name: Build # Workaround for incompatibility between gcloud and windows-2019 runners.
run: dotnet build csharp/src/Google.Protobuf.sln - name: Install Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.9'
- name: Use custom python for gcloud
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
shell: bash
- name: Run Tests - name: Run tests
run: dotnet test csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj uses: protocolbuffers/protobuf-ci/bash@v2
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: |
dotnet build csharp/src/Google.Protobuf.sln
dotnet test csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
linux-aarch64: linux-aarch64:
name: Linux aarch64 name: Linux aarch64

Loading…
Cancel
Save