Skip to content

Commit

Permalink
upgrade test images to bazel 7
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 644466391
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jul 3, 2024
1 parent e931905 commit d752706
Show file tree
Hide file tree
Showing 18 changed files with 243 additions and 205 deletions.
113 changes: 68 additions & 45 deletions .github/workflows/test_cpp.yml

Large diffs are not rendered by default.

33 changes: 25 additions & 8 deletions .github/workflows/test_csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ permissions:

jobs:
linux:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
bazel-version: ['7.1.2']
name: Linux
runs-on: ubuntu-latest
steps:
Expand All @@ -23,11 +27,13 @@ jobs:

# TODO Run this with Bazel once codegen is handled properly.
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
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:7.1.2-3.1.415-6.0.100-2d59f978645853c5156710320db037095b6a39e5
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
entrypoint: /bin/bash
bazel-version: ${{ matrix.bazel-version }}
staleness-image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:${{ matrix.bazel-version }}-bec4e87effd62da1d4f9a13d377e37bcb80376c9
command: >-
-c "
cd csharp &&
Expand All @@ -39,14 +45,18 @@ jobs:
run: sudo rm -rf _build .repository-cache

- name: Run conformance tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
uses: protocolbuffers/protobuf-ci/bazel-docker@b7-test
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:7.1.2-3.1.415-6.0.100-2d59f978645853c5156710320db037095b6a39e5
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: csharp_linux
bazel: test //csharp:conformance_test --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=/home/bazel

windows:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
bazel-version: ['7.1.2']
name: Windows
runs-on: windows-2019
steps:
Expand All @@ -70,29 +80,35 @@ jobs:
shell: bash

- name: Run tests
uses: protocolbuffers/protobuf-ci/bash@v3
uses: protocolbuffers/protobuf-ci/bash@b7-test
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-version: ${{ matrix.bazel-version }}
command: |
dotnet build csharp/src/Google.Protobuf.sln
dotnet test csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
linux-aarch64:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
bazel-version: ['7.1.2']
name: Linux aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
uses: protocolbuffers/protobuf-ci/checkout@b7-test
with:
ref: ${{ inputs.safe-checkout }}

- name: Build protobuf C# tests under x86_64 docker image
# Tests are built "dotnet publish" because we want all the dependencies to the copied to the destination directory
# (we want to avoid references to ~/.nuget that won't be available in the subsequent docker run)
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-version: ${{ matrix.bazel-version }}
command: >-
/bin/bash -cex '
DOTNET_CLI_TELEMETRY_OPTOUT=true
Expand All @@ -106,11 +122,12 @@ jobs:
# running under current user's UID and GID. To be able to do that, we need to provide a home directory for the user
# otherwise the UID would be homeless under the docker container and pip install wouldn't work. For simplicity,
# we just run map the user's home to a throwaway temporary directory
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim-arm64v8
skip-staleness-check: true
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-version: ${{ matrix.bazel-version }}
command: >-
/bin/bash -cex '
DOTNET_CLI_TELEMETRY_OPTOUT=true
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/test_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,36 @@ jobs:
strategy:
fail-fast: false
matrix:
bazel-version: ['7.1.2']
include:
- name: OpenJDK 8
version: '8'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8-23af5a0a246d26a2b8b658392d234be545f9c202
# TODO: b/318555165 - enable the layering check. Currently it does
# not work correctly with the toolchain in this Docker image.
targets: //java/... //java/internal:java_version //compatibility/... --features=-layering_check
- name: OpenJDK 11
version: '11'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java@sha256:f0a43fe8eb5a5180b4207f23d4ad9ebf618b1b78d3403eeeb4e7e45c9b1c7a9d
targets: //java/... //java/internal:java_version //compatibility/...
- name: OpenJDK 17
version: '17'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:17-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java@sha256:fe556e90c77901a63d5acf0567bd33130125d5fe4d50af20271f8a32314a5bc6
targets: //java/... //java/internal:java_version //compatibility/...
- name: aarch64
version: 'aarch64'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-63dd26c0c7a808d92673a3e52e848189d4ab0f17
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:${{ matrix.bazel-version }}-aarch64-f42c2179c00aaa8fedfe95cdc0bf14e862541604
targets: //java/... //compatibility/... //src/google/protobuf/compiler:protoc_aarch64_test

name: Linux ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
uses: protocolbuffers/protobuf-ci/checkout@b7-test
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
uses: protocolbuffers/protobuf-ci/bazel-docker@b7-test
with:
image: ${{ matrix.image }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
Expand Down Expand Up @@ -75,14 +76,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
uses: protocolbuffers/protobuf-ci/checkout@b7-test
with:
ref: ${{ inputs.safe-checkout }}
- name: Build protoc
id: build-protoc
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@b7-test
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:{{ matrix.bazel-version }}-bec4e87effd62da1d4f9a13d377e37bcb80376c9
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-x86_64
- name: Move protoc into place and clean up
Expand All @@ -91,12 +92,12 @@ jobs:
sudo rm -rf _build
- name: Install snapshot version locally (not using generated pom.xml)
run: |
mvn -e -B -Dhttps.protocols=TLSv1.2 install -Dmaven.test.skip=true
mvn -X -e -B -Dhttps.protocols=TLSv1.2 install -Dmaven.test.skip=true
working-directory: java
- name: Generate pom.xml files from the template
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
uses: protocolbuffers/protobuf-ci/bazel-docker@b7-test
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-21efb73c613deddd6db6a0a86f262324a77de13f
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: java_linux/11
# protobuf-java and protobuf-java-util are the member of the BOM
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/test_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
bazel-version: ['7.1.2']
include:
- name: 8.1 Optimized
version: "8.1.14"
Expand All @@ -41,7 +42,7 @@ jobs:
command: composer test \&\& composer test_c

name: Linux ${{ matrix.name}}
runs-on: ubuntu-latest
runs-on: ubuntu-20-large
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
Expand All @@ -53,9 +54,10 @@ jobs:
cache-prefix: php-${{ matrix.version-short }}
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.version }}-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.bazel-version -${{ matrix.version }}-21efb73c613deddd6db6a0a86f262324a77de13f
bazel-version: ${{ matrix.bazel-version }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache
command: ${{ matrix.command }}
Expand All @@ -65,6 +67,7 @@ jobs:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
version: ['8.1']
bazel-version: ['7.1.2']
suffix: [ '', '-zts']
test: ['test', 'test_c']
exclude:
Expand All @@ -77,9 +80,9 @@ jobs:
test_name: ' Extension'

name: Linux 32-bit ${{ matrix.version}}${{ matrix.suffix_name }}${{ matrix.test_name }}
runs-on: ubuntu-latest
runs-on: ubuntu-20-large
env:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:836f2cedcfe351d9a30055076630408e61994fc7d783e8333a99570968990eeb
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:429f924aec315704b4233adcbe4b29006116f27769db98acd176b9eb69c31299
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
Expand All @@ -90,7 +93,7 @@ jobs:
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:${{ matrix.bazel-version }}-bec4e87effd62da1d4f9a13d377e37bcb80376c9
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-i386

Expand All @@ -101,9 +104,10 @@ jobs:
directory: php

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: ${{ env.image }}
bazel-version: ${{ matrix.bazel-version }}
platform: linux/386
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
Expand All @@ -116,7 +120,7 @@ jobs:
linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
runs-on: ubuntu-20-large
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
Expand All @@ -127,7 +131,7 @@ jobs:
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:${{ matrix.bazel-version }}-bec4e87effd62da1d4f9a13d377e37bcb80376c9
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-aarch64

Expand All @@ -138,10 +142,11 @@ jobs:
directory: php

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-aarch64@sha256:77ff9fdec867bbfb290ee0b10d8b7a3e5e434155daa5ec93de7341c7592b858d
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-aarch64@sha256:23a3b88e9a066f5468457088b92ba11fd145b5aa4faa79b00189bdee54387cd9
platform: linux/arm64
bazel-version: ${{ matrix.bazel-version }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
command: >-
Expand Down Expand Up @@ -186,9 +191,10 @@ jobs:
directory: php

- name: Run tests
uses: protocolbuffers/protobuf-ci/bash@v3
uses: protocolbuffers/protobuf-ci/bash@b7-test
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-version: ${{ matrix.bazel-version }}
command: |
pushd php
php -v
Expand All @@ -198,8 +204,9 @@ jobs:
popd
- name: Run conformance tests
uses: protocolbuffers/protobuf-ci/bazel@v3
uses: protocolbuffers/protobuf-ci/bazel@b7-test
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_macos/${{ matrix.version }}
bazel-version: ${{ matrix.bazel-version }}
bazel: test //php:conformance_test_c --action_env=PATH --test_env=PATH
8 changes: 6 additions & 2 deletions .github/workflows/test_php_ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
ref: ${{ inputs.safe-checkout }}

- name: Package extension
uses: protocolbuffers/protobuf-ci/bazel@v3
uses: protocolbuffers/protobuf-ci/bazel@b7-test
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_ext/${{ matrix.version }}
version: 7.1.2
bash: >
./regenerate_stale_files.sh $BAZEL_FLAGS;
bazel build //php:release $BAZEL_FLAGS;
Expand All @@ -41,6 +42,7 @@ jobs:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
bazel-version: ['7.1.2']
version: ["8.1", "8.2", "8.3"]
name: Build ${{ matrix.version }}
runs-on: ubuntu-latest
Expand All @@ -50,9 +52,11 @@ jobs:
name: protobuf-php-release

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
uses: protocolbuffers/protobuf-ci/docker@b7-test
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-extension:${{ matrix.version }}-a48f26c08d9a803dd0177dda63563f6ea6f7b2d4
staleness-image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:${{ matrix.bazel-version }}-bec4e87effd62da1d4f9a13d377e37bcb80376c9
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-version: ${{ matrix.bazel-version }}
skip-staleness-check: true
command: protobuf-*.tgz
15 changes: 9 additions & 6 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
matrix:
type: [ Pure, C++]
# TODO: b/309627662 - Add coverage for Python 3.12.
version: ["3.8", "3.9", "3.10", "3.11"]
version: ["3.9", "3.10", "3.11"]
bazel-version: ["7.1.2"]
include:
- type: Pure
targets: //python/... //python:python_version_test
Expand All @@ -30,8 +31,8 @@ jobs:
version: aarch64
targets: //python/... //python:aarch64_test
# TODO Enable this once conformance tests are fixed.
flags: --define=use_fast_cpp_protos=true --test_tag_filters=-conformance
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-63dd26c0c7a808d92673a3e52e848189d4ab0f17
flags: --define=use_fast_cpp_protos=true --test_tag_filters=-conformance --test_verbose_timeout_warnings
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:${matrix.bazel-version}-aarch64-f42c2179c00aaa8fedfe95cdc0bf14e862541604

name: Linux ${{ matrix.type }} ${{ matrix.version }}
runs-on: ubuntu-latest
Expand All @@ -41,9 +42,9 @@ jobs:
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
uses: protocolbuffers/protobuf-ci/bazel-docker@b7-test
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-63dd26c0c7a808d92673a3e52e848189d4ab0f17', matrix.version) }}
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:7.1.2-{0}-8f49ab0560dac854ccd42749a07175803d7d2928', matrix.version) }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }}
bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION
Expand All @@ -57,6 +58,7 @@ jobs:
type: [ Pure, C++]
# TODO Consider expanding this set of versions.
version: [ "3.12" ]
bazel-version: ["7.1.2"]
include:
- type: Pure
targets: //python/... //python:python_version_test
Expand Down Expand Up @@ -88,12 +90,13 @@ jobs:
source venv/bin/activate
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel@v3
uses: protocolbuffers/protobuf-ci/bazel@b7-test
env:
KOKORO_PYTHON_VERSION: ${{ matrix.version }}
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: python_macos/${{ matrix.type }}_${{ matrix.version }}
version: ${{ matrix.bazel-version }}
bazel: >-
test ${{ matrix.targets }} ${{ matrix.flags }}
--test_env=KOKORO_PYTHON_VERSION=${{ matrix.version }}
Expand Down
Loading

0 comments on commit d752706

Please sign in to comment.