Re-enable non-macos jobs.
diff --git a/.github/workflows/test_bazel.yml b/.github/workflows/test_bazel.yml index eaf1af8..ffd174c 100644 --- a/.github/workflows/test_bazel.yml +++ b/.github/workflows/test_bazel.yml
@@ -21,92 +21,89 @@ contents: read jobs: -# examples: -# strategy: -# fail-fast: false -# matrix: -# runner: [ ubuntu, windows, macos ] -# bazelversion: [ '8.7.0', '9.2.0' ] -# bzlmod: [ true, false ] -# toolchain_resolution: -# # Default flags, uses from prebuilt protoc -# - "" -# # Still uses prebuilt protoc -# - "--incompatible_enable_proto_toolchain_resolution=false" -# # Uses protoc from source. -# - "--@com_google_protobuf//bazel/flags:prefer_prebuilt_protoc=false" -# exclude: -# - bazelversion: '9.2.0' -# bzlmod: false -# runs-on: ${{ matrix.runner }}-latest -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }} ${{ matrix.toolchain_resolution && ' (toolchain resolution)' || '' }} -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# # rules_jvm_external doesn't support Java 8, which is the default version -# # on some github runners. When this is selected, it results in some -# # opaque errors about coursier (see -# # https://github.com/bazel-contrib/rules_jvm_external/issues/1337). -# - name: Pin to Java 11 -# uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# with: -# distribution: 'temurin' -# java-version: '11' -# -# - name: Windows startup flags -# if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }} -# working-directory: examples -# shell: bash -# run: echo "startup --output_user_root=C:/ --windows_enable_symlinks" >> .bazelrc -# -# - name: Configure Bazel version -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# working-directory: examples -# shell: bash -# run: echo "${{ matrix.bazelversion }}" > .bazelversion -# -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel@v6 -# with: -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: examples-${{ matrix.bazelversion }}-${{ matrix.bzlmod }}-${{ matrix.toolchain_resolution }} -# version: ${{ matrix.bazelversion }} -# bash: > -# cd examples; -# bazel build //... @com_google_protobuf-examples-with-hyphen//... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }}; -# -# bazel-tests-ubuntu: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# name: Bazel Tests ubuntu -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Run tests -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: "bazel-tests" -# bazel: test //bazel/... + examples: + strategy: + fail-fast: false + matrix: + runner: [ ubuntu, windows, macos ] + bazelversion: [ '8.7.0', '9.2.0' ] + bzlmod: [ true, false ] + toolchain_resolution: + # Default flags, uses from prebuilt protoc + - "" + # Still uses prebuilt protoc + - "--incompatible_enable_proto_toolchain_resolution=false" + # Uses protoc from source. + - "--@com_google_protobuf//bazel/flags:prefer_prebuilt_protoc=false" + exclude: + - bazelversion: '9.2.0' + bzlmod: false + runs-on: ${{ matrix.runner }}-latest + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }} ${{ matrix.toolchain_resolution && ' (toolchain resolution)' || '' }} + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + # rules_jvm_external doesn't support Java 8, which is the default version + # on some github runners. When this is selected, it results in some + # opaque errors about coursier (see + # https://github.com/bazel-contrib/rules_jvm_external/issues/1337). + - name: Pin to Java 11 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + with: + distribution: 'temurin' + java-version: '11' + + - name: Windows startup flags + if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }} + working-directory: examples + shell: bash + run: echo "startup --output_user_root=C:/ --windows_enable_symlinks" >> .bazelrc + + - name: Configure Bazel version + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + working-directory: examples + shell: bash + run: echo "${{ matrix.bazelversion }}" > .bazelversion + + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel@v6 + with: + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: examples-${{ matrix.bazelversion }}-${{ matrix.bzlmod }}-${{ matrix.toolchain_resolution }} + version: ${{ matrix.bazelversion }} + bash: > + cd examples; + bazel build //... @com_google_protobuf-examples-with-hyphen//... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }}; + + bazel-tests-ubuntu: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + name: Bazel Tests ubuntu + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Run tests + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: "bazel-tests" + bazel: test //bazel/... bazel-tests-windows-macos: strategy: fail-fast: false # Don't cancel all jobs if one fails. matrix: - runner: [ - # windows-2022, - macos-15 - ] + runner: [ windows-2022, macos-15 ] name: Bazel Tests ${{ matrix.runner }} runs-on: ${{ matrix.runner }} steps:
diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 4d47331..c136277 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml
@@ -23,428 +23,428 @@ contents: read jobs: -# linux: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# config: -# - { name: Optimized, flags: --config=opt } -# - { name: Debug, flags: --config=dbg, continuous-only: true } -# - { name: ASAN, flags: --config=asan, runner: ubuntu-22-4core } -# - { name: MSAN, flags: --config=docker-msan, runner: ubuntu-22-4core, continuous-only: true } -# - { name: TSAN, flags: --config=tsan, runner: ubuntu-22-4core, continuous-only: true } -# - { name: UBSAN, flags: --config=ubsan, runner: ubuntu-22-4core, continuous-only: true,} -# - { name: No-RTTI, flags: --cxxopt=-fno-rtti, continuous-only: true } -# include: -# # Set defaults -# - image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:8.7.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# - targets: //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests -# # Override cases with custom images -# - config: { name: "Bazel8", flags: --cxxopt="-Wno-self-assign-overloaded" } -# cache_key: Bazel8 -# image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8" -# targets: "//src/... //third_party/utf8_range/..." -# - config: { name: "Bazel9", flags: "--cxxopt=-Wno-self-assign-overloaded" } -# cache_key: Bazel9 -# image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8" -# targets: "//src/... //third_party/utf8_range/..." -# - config: { name: "TCMalloc" } -# cache_key: TcMalloc -# image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc:8.7.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 " -# targets: "//src/... //third_party/utf8_range/..." -# - config: { name: "aarch64", flags: "--platforms=//build_defs:linux-aarch_64" } -# cache_key: aarch64-bazel8 -# targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test //third_party/utf8_range/..." -# image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:8.7.0-aarch64-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 " -# name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.config.name }} -# runs-on: ${{ matrix.config.runner || 'ubuntu-latest' }} -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Prime the cache -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: ${{ matrix.image }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/${{ matrix.cache_key }} -# bazel: fetch ${{ matrix.targets }} ${{ matrix.config.flags }} -# exclude-targets: ${{ matrix.exclude-targets }} -# - name: Run tests -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: ${{ matrix.image }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/${{ matrix.cache_key }} -# bazel: test ${{ matrix.targets }} ${{ matrix.config.flags }} -# exclude-targets: ${{ matrix.exclude-targets }} -# -# linux-gcc: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# version: ['10.5', '13.4'] -# name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Linux GCC ${{ matrix.version }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Prime the cache -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-${{ matrix.version }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/gcc-${{ matrix.version }} -# bazel: fetch //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests -# - name: Run tests -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-${{ matrix.version }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/gcc-${{ matrix.version }} -# bazel: test //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests -# -# linux-release: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# arch: [x86_64, aarch64] -# include: -# - arch: aarch64 -# continuous-only: true -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux Release ${{ matrix.arch }} -# runs-on: ubuntu-22-4core -# steps: -# - name: Check initial disk space -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# shell: bash -# run: df -h -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Check disk space after checkout -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# shell: bash -# run: df -h -# - name: Cross compile protoc for ${{ matrix.arch }} -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# id: cross-compile -# uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# architecture: linux-${{ matrix.arch }} -# - name: Check disk space after cross compile -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# shell: bash -# run: df -h -# - name: Setup sccache -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# with: -# cache-prefix: linux-release-${{ matrix.arch }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# - name: Check disk space after setup sccache -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# shell: bash -# run: df -h -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:8.7.0-${{ matrix.arch }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# entrypoint: bash -# command: > -# -c "set -ex; -# sccache -z; -# cmake . -DWITH_PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} -# -Dprotobuf_BUILD_TESTS=ON -# -Dprotobuf_BUILD_CONFORMANCE=ON -DCMAKE_CXX_STANDARD=17 -# -Dprotobuf_WITH_ZLIB=OFF ${{ env.SCCACHE_CMAKE_FLAGS }}; -# cmake --build . --parallel 20; -# ctest --no-tests=error --parallel 20; -# sccache -s" -# - name: Check disk space after run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# shell: bash -# run: df -h -# -# linux-cmake: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# include: -# - flags: -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_CONFORMANCE=ON -# - name: Ninja -# flags: -G Ninja -DCMAKE_CXX_STANDARD=17 -# continuous-only: true -# - name: Shared -# flags: -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=17 -# continuous-only: true -# - name: C++20 -# flags: -DCMAKE_CXX_STANDARD=20 -# - name: Package -# flags: -DCMAKE_CXX_STANDARD=17 -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON -# - name: Fetch -# flags: -DCMAKE_CXX_STANDARD=17 -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON -# -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux CMake ${{ matrix.name}} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Setup sccache -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# with: -# cache-prefix: linux-cmake -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# command: >- -# /test.sh ${{ matrix.flags}} ${{ env.SCCACHE_CMAKE_FLAGS }} -# -Dprotobuf_BUILD_TESTS=ON ${{ matrix.package_flags }} -# -# linux-cmake-install: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# type: [package, static, fetch] -# include: -# # Set defaults -# - type: package -# name: Install -# flags: -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON -Dprotobuf_BUILD_SHARED_LIBS=ON -# - type: static -# name: Install (static) -# flags: -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON -Dprotobuf_BUILD_SHARED_LIBS=OFF -# - type: fetch -# name: Install (Fetch) -# flags: -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON -Dprotobuf_BUILD_SHARED_LIBS=ON -# continuous-only: true -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }}Linux CMake ${{ matrix.name }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Setup sccache -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# with: -# cache-prefix: linux-cmake-install -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# -# - name: Run tests -# uses: protocolbuffers/protobuf-ci/docker@v6 -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# command: >- -# /install.sh -DCMAKE_CXX_STANDARD=17 ${{ env.SCCACHE_CMAKE_FLAGS }} -# ${{ matrix.flags }} -# \&\& -# cp build/install_manifest.txt . -# \&\& -# /test.sh -# ${{ env.SCCACHE_CMAKE_FLAGS }} -# -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON -# -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF -# -Dprotobuf_BUILD_CONFORMANCE=ON -# -DCMAKE_CXX_STANDARD=17 -# ${{ matrix.flags }} -# -# - name: Clean up install manifest -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# run: | -# set -ex -# mkdir manifest -# cat install_manifest.txt | sort | sed 's:/usr/local/::g' > manifest/all.txt -# cat manifest/all.txt | grep -E '^include/' | grep -vE 'internal' | sed 's:^include/::g' > manifest/include.txt -# cat manifest/all.txt | grep -E '^bin/' | grep -vE '\-[0-9]+\.[0-9]+\.[0-9]+$' | sed 's:^bin/::g' > manifest/bin.txt -# cat manifest/all.txt | grep -E '^lib/' | grep -vE '\.[0-9]+\.[0-9]+\.[0-9]+$' | sed 's:^lib/::g' > manifest/lib.txt -# -# - name: Upload install manifest -# uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# with: -# name: installed_files_${{ matrix.type }} -# path: manifest/*.txt -# -# install-manifests: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# type: [include, bin, lib] -# build: [static, package] -# include: -# - type: lib -# build: static -# golden: 'lib_static' -# - type: lib -# build: package -# golden: 'lib_shared' -# name: Check Installed Files -# needs: linux-cmake-install -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Download manifest -# uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 -# with: -# name: installed_files_${{ matrix.build }} -# path: ${{ matrix.build }} -# -# - name: Compare against golden -# run: | -# set +e -# GOLDEN_FILE=cmake/installed_${{ matrix.golden || matrix.type }}_golden.txt -# DIFF="$(diff -u ${GOLDEN_FILE} ${{ matrix.build }}/${{ matrix.type }}.txt)" -# if [ -n "$DIFF" ]; then -# echo "Installed files do not match goldens!" -# echo "If this is expected, please update the golden file: ${GOLDEN_FILE}" -# echo "The following diffs were found:" -# echo "$DIFF" -# exit 1 -# else -# echo "Installed files match goldens." -# fi -# -# # This test should always be skipped on presubmit -# linux-cmake-examples: -# name: ${{ inputs.continuous-prefix }} Linux CMake Examples -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Setup sccache -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# with: -# cache-prefix: linux-cmake-examples -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# -# - name: Run tests -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# command: >- -# /install.sh -DCMAKE_CXX_STANDARD=17 ${{ env.SCCACHE_CMAKE_FLAGS }} -# -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=OFF -# -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_TESTS=ON \&\& -# mkdir examples/build \&\& -# cd examples/build \&\& -# cmake .. -DCMAKE_CXX_STANDARD=17 \&\& -# cmake --build . -# -# linux-cmake-gcc: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# include: -# - name: C++17 -# flags: -DCMAKE_CXX_STANDARD=17 -# continuous-only: true -# - name: C++20 -# flags: -DCMAKE_CXX_STANDARD=20 -# -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux CMake GCC ${{ matrix.name }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Setup sccache -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# with: -# cache-prefix: linux-cmake-gcc -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-12.5-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# entrypoint: bash -# command: >- -# -c 'set -ex; -# cd /workspace; -# sccache -z; -# cmake . -Dprotobuf_BUILD_TESTS=ON ${{ matrix.flags }} ${{ env.SCCACHE_CMAKE_FLAGS }}; -# cmake --build . --parallel 20; -# ctest --no-tests=error --verbose --parallel 20; -# sccache -s' -# -# linux-cmake-32-bit: -# name: Linux CMake 32-bit -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Setup sccache -# uses: protocolbuffers/protobuf-ci/sccache@v6 -# with: -# cache-prefix: linux-cmake-32-bit -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# -# - name: Run tests -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:d6028ab408c49932836cdc514116f06886d7f6868a4d430630aa52adc5aee2fc -# platform: linux/386 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# entrypoint: bash -# command: >- -# -c 'set -ex; -# cd /workspace; -# sccache -z; -# cmake . -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_TESTS=ON ${{ env.SCCACHE_CMAKE_FLAGS }}; -# cmake --build . --parallel 20; -# ctest --no-tests=error --verbose --parallel 20; -# sccache -s' + linux: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + config: + - { name: Optimized, flags: --config=opt } + - { name: Debug, flags: --config=dbg, continuous-only: true } + - { name: ASAN, flags: --config=asan, runner: ubuntu-22-4core } + - { name: MSAN, flags: --config=docker-msan, runner: ubuntu-22-4core, continuous-only: true } + - { name: TSAN, flags: --config=tsan, runner: ubuntu-22-4core, continuous-only: true } + - { name: UBSAN, flags: --config=ubsan, runner: ubuntu-22-4core, continuous-only: true,} + - { name: No-RTTI, flags: --cxxopt=-fno-rtti, continuous-only: true } + include: + # Set defaults + - image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:8.7.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + - targets: //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests + # Override cases with custom images + - config: { name: "Bazel8", flags: --cxxopt="-Wno-self-assign-overloaded" } + cache_key: Bazel8 + image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8" + targets: "//src/... //third_party/utf8_range/..." + - config: { name: "Bazel9", flags: "--cxxopt=-Wno-self-assign-overloaded" } + cache_key: Bazel9 + image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8" + targets: "//src/... //third_party/utf8_range/..." + - config: { name: "TCMalloc" } + cache_key: TcMalloc + image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc:8.7.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 " + targets: "//src/... //third_party/utf8_range/..." + - config: { name: "aarch64", flags: "--platforms=//build_defs:linux-aarch_64" } + cache_key: aarch64-bazel8 + targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test //third_party/utf8_range/..." + image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:8.7.0-aarch64-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 " + name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.config.name }} + runs-on: ${{ matrix.config.runner || 'ubuntu-latest' }} + steps: + - name: Checkout pending changes + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Prime the cache + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: ${{ matrix.image }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/${{ matrix.cache_key }} + bazel: fetch ${{ matrix.targets }} ${{ matrix.config.flags }} + exclude-targets: ${{ matrix.exclude-targets }} + - name: Run tests + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: ${{ matrix.image }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/${{ matrix.cache_key }} + bazel: test ${{ matrix.targets }} ${{ matrix.config.flags }} + exclude-targets: ${{ matrix.exclude-targets }} + + linux-gcc: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + version: ['10.5', '13.4'] + name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Linux GCC ${{ matrix.version }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + with: + ref: ${{ inputs.safe-checkout }} + - name: Prime the cache + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-${{ matrix.version }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/gcc-${{ matrix.version }} + bazel: fetch //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests + - name: Run tests + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + if: ${{ !matrix.config.continuous-only || inputs.continuous-run }} + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-${{ matrix.version }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/gcc-${{ matrix.version }} + bazel: test //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests + + linux-release: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + arch: [x86_64, aarch64] + include: + - arch: aarch64 + continuous-only: true + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux Release ${{ matrix.arch }} + runs-on: ubuntu-22-4core + steps: + - name: Check initial disk space + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + shell: bash + run: df -h + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Check disk space after checkout + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + shell: bash + run: df -h + - name: Cross compile protoc for ${{ matrix.arch }} + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + id: cross-compile + uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + architecture: linux-${{ matrix.arch }} + - name: Check disk space after cross compile + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + shell: bash + run: df -h + - name: Setup sccache + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/sccache@v6 + with: + cache-prefix: linux-release-${{ matrix.arch }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + - name: Check disk space after setup sccache + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + shell: bash + run: df -h + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:8.7.0-${{ matrix.arch }}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + entrypoint: bash + command: > + -c "set -ex; + sccache -z; + cmake . -DWITH_PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} + -Dprotobuf_BUILD_TESTS=ON + -Dprotobuf_BUILD_CONFORMANCE=ON -DCMAKE_CXX_STANDARD=17 + -Dprotobuf_WITH_ZLIB=OFF ${{ env.SCCACHE_CMAKE_FLAGS }}; + cmake --build . --parallel 20; + ctest --no-tests=error --parallel 20; + sccache -s" + - name: Check disk space after run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + shell: bash + run: df -h + + linux-cmake: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + include: + - flags: -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_CONFORMANCE=ON + - name: Ninja + flags: -G Ninja -DCMAKE_CXX_STANDARD=17 + continuous-only: true + - name: Shared + flags: -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=17 + continuous-only: true + - name: C++20 + flags: -DCMAKE_CXX_STANDARD=20 + - name: Package + flags: -DCMAKE_CXX_STANDARD=17 -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON + - name: Fetch + flags: -DCMAKE_CXX_STANDARD=17 -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON + + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux CMake ${{ matrix.name}} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup sccache + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/sccache@v6 + with: + cache-prefix: linux-cmake + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: >- + /test.sh ${{ matrix.flags}} ${{ env.SCCACHE_CMAKE_FLAGS }} + -Dprotobuf_BUILD_TESTS=ON ${{ matrix.package_flags }} + + linux-cmake-install: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + type: [package, static, fetch] + include: + # Set defaults + - type: package + name: Install + flags: -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON -Dprotobuf_BUILD_SHARED_LIBS=ON + - type: static + name: Install (static) + flags: -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=ON -Dprotobuf_BUILD_SHARED_LIBS=OFF + - type: fetch + name: Install (Fetch) + flags: -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON -Dprotobuf_BUILD_SHARED_LIBS=ON + continuous-only: true + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }}Linux CMake ${{ matrix.name }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup sccache + uses: protocolbuffers/protobuf-ci/sccache@v6 + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + with: + cache-prefix: linux-cmake-install + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v6 + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: >- + /install.sh -DCMAKE_CXX_STANDARD=17 ${{ env.SCCACHE_CMAKE_FLAGS }} + ${{ matrix.flags }} + \&\& + cp build/install_manifest.txt . + \&\& + /test.sh + ${{ env.SCCACHE_CMAKE_FLAGS }} + -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON + -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF + -Dprotobuf_BUILD_CONFORMANCE=ON + -DCMAKE_CXX_STANDARD=17 + ${{ matrix.flags }} + + - name: Clean up install manifest + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + run: | + set -ex + mkdir manifest + cat install_manifest.txt | sort | sed 's:/usr/local/::g' > manifest/all.txt + cat manifest/all.txt | grep -E '^include/' | grep -vE 'internal' | sed 's:^include/::g' > manifest/include.txt + cat manifest/all.txt | grep -E '^bin/' | grep -vE '\-[0-9]+\.[0-9]+\.[0-9]+$' | sed 's:^bin/::g' > manifest/bin.txt + cat manifest/all.txt | grep -E '^lib/' | grep -vE '\.[0-9]+\.[0-9]+\.[0-9]+$' | sed 's:^lib/::g' > manifest/lib.txt + + - name: Upload install manifest + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + with: + name: installed_files_${{ matrix.type }} + path: manifest/*.txt + + install-manifests: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + type: [include, bin, lib] + build: [static, package] + include: + - type: lib + build: static + golden: 'lib_static' + - type: lib + build: package + golden: 'lib_shared' + name: Check Installed Files + needs: linux-cmake-install + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Download manifest + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: installed_files_${{ matrix.build }} + path: ${{ matrix.build }} + + - name: Compare against golden + run: | + set +e + GOLDEN_FILE=cmake/installed_${{ matrix.golden || matrix.type }}_golden.txt + DIFF="$(diff -u ${GOLDEN_FILE} ${{ matrix.build }}/${{ matrix.type }}.txt)" + if [ -n "$DIFF" ]; then + echo "Installed files do not match goldens!" + echo "If this is expected, please update the golden file: ${GOLDEN_FILE}" + echo "The following diffs were found:" + echo "$DIFF" + exit 1 + else + echo "Installed files match goldens." + fi + + # This test should always be skipped on presubmit + linux-cmake-examples: + name: ${{ inputs.continuous-prefix }} Linux CMake Examples + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup sccache + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/sccache@v6 + with: + cache-prefix: linux-cmake-examples + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + + - name: Run tests + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.16.9-9626718698895971df3953d4aa2321d7425f3c5f + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: >- + /install.sh -DCMAKE_CXX_STANDARD=17 ${{ env.SCCACHE_CMAKE_FLAGS }} + -Dprotobuf_LOCAL_DEPENDENCIES_ONLY=OFF + -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_TESTS=ON \&\& + mkdir examples/build \&\& + cd examples/build \&\& + cmake .. -DCMAKE_CXX_STANDARD=17 \&\& + cmake --build . + + linux-cmake-gcc: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + include: + - name: C++17 + flags: -DCMAKE_CXX_STANDARD=17 + continuous-only: true + - name: C++20 + flags: -DCMAKE_CXX_STANDARD=20 + + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux CMake GCC ${{ matrix.name }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup sccache + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/sccache@v6 + with: + cache-prefix: linux-cmake-gcc + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:8.7.0-12.5-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + entrypoint: bash + command: >- + -c 'set -ex; + cd /workspace; + sccache -z; + cmake . -Dprotobuf_BUILD_TESTS=ON ${{ matrix.flags }} ${{ env.SCCACHE_CMAKE_FLAGS }}; + cmake --build . --parallel 20; + ctest --no-tests=error --verbose --parallel 20; + sccache -s' + + linux-cmake-32-bit: + name: Linux CMake 32-bit + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Setup sccache + uses: protocolbuffers/protobuf-ci/sccache@v6 + with: + cache-prefix: linux-cmake-32-bit + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:d6028ab408c49932836cdc514116f06886d7f6868a4d430630aa52adc5aee2fc + platform: linux/386 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + entrypoint: bash + command: >- + -c 'set -ex; + cd /workspace; + sccache -z; + cmake . -DCMAKE_CXX_STANDARD=17 -Dprotobuf_BUILD_TESTS=ON ${{ env.SCCACHE_CMAKE_FLAGS }}; + cmake --build . --parallel 20; + ctest --no-tests=error --verbose --parallel 20; + sccache -s' non-linux: strategy: @@ -459,18 +459,18 @@ os: macos-15 cache_key: macos-15-intel bazel: test --cpu=darwin_x86_64 //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests -# - name: Windows Bazel -# os: windows-2022 -# cache_key: windows-2022-msvc-cl -# bazel: test //src/... conformance:conformance_framework_tests --config=msvc-cl -# - name: Windows Bazel C++20 -# os: windows-2022 -# cache_key: windows-2022-msvc-cl -# bazel: test //src/... conformance:conformance_framework_tests --config=msvc-cl --cxxopt="-std:c++20" -# - name: Windows Bazel clang-cl -# os: windows-2022 -# cache_key: windows-2022-clang-cl -# bazel: test //src/... conformance:conformance_framework_tests + - name: Windows Bazel + os: windows-2022 + cache_key: windows-2022-msvc-cl + bazel: test //src/... conformance:conformance_framework_tests --config=msvc-cl + - name: Windows Bazel C++20 + os: windows-2022 + cache_key: windows-2022-msvc-cl + bazel: test //src/... conformance:conformance_framework_tests --config=msvc-cl --cxxopt="-std:c++20" + - name: Windows Bazel clang-cl + os: windows-2022 + cache_key: windows-2022-clang-cl + bazel: test //src/... conformance:conformance_framework_tests name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} ${{ matrix.name }} runs-on: ${{ matrix.os }} steps: @@ -501,40 +501,40 @@ os: macos-15 cache-prefix: macos-cmake continuous-only: true -# - name: Windows CMake -# os: windows-2022 -# flags: >- -# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON -# -Dprotobuf_BUILD_SHARED_LIBS=OFF -# -Dprotobuf_BUILD_EXAMPLES=ON -# vsversion: '2022' -# cache-prefix: windows-2022-cmake -# - name: Windows CMake 32-bit -# os: windows-2022 -# flags: >- -# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON -# vsversion: '2022' -# windows-arch: 'win32' -# cache-prefix: windows-2022-win32-cmake -# continuous-only: true -# - name: Windows CMake Shared -# os: windows-2022 -# flags: >- -# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON -# -Dprotobuf_BUILD_SHARED_LIBS=ON -# vsversion: '2022' -# cache-prefix: windows-2022-cmake -# - name: Windows CMake Install -# os: windows-2022 -# install-flags: >- -# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -# flags: >- -# -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON -# -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON -# -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF -# vsversion: '2022' -# cache-prefix: windows-2022-cmake -# continuous-only: true + - name: Windows CMake + os: windows-2022 + flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON + -Dprotobuf_BUILD_SHARED_LIBS=OFF + -Dprotobuf_BUILD_EXAMPLES=ON + vsversion: '2022' + cache-prefix: windows-2022-cmake + - name: Windows CMake 32-bit + os: windows-2022 + flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON + vsversion: '2022' + windows-arch: 'win32' + cache-prefix: windows-2022-win32-cmake + continuous-only: true + - name: Windows CMake Shared + os: windows-2022 + flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON + -Dprotobuf_BUILD_SHARED_LIBS=ON + vsversion: '2022' + cache-prefix: windows-2022-cmake + - name: Windows CMake Install + os: windows-2022 + install-flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF + flags: >- + -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=ON + -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON + -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF + vsversion: '2022' + cache-prefix: windows-2022-cmake + continuous-only: true name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} ${{ matrix.name }} runs-on: ${{ matrix.os }} steps: @@ -613,46 +613,46 @@ shell: bash run: sccache -s -# linux-abseil-head: -# name: ${{ inputs.continuous-prefix }} Linux Abseil HEAD -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Checkout Abseil HEAD -# if: ${{ inputs.continuous-run }} -# uses: actions/checkout@v5 -# with: -# repository: abseil/abseil-cpp -# path: abseil-cpp-head -# - name: Run tests -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/abseil_head -# bazel: test //src/... --override_module=abseil-cpp=abseil-cpp-head + linux-abseil-head: + name: ${{ inputs.continuous-prefix }} Linux Abseil HEAD + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Checkout Abseil HEAD + if: ${{ inputs.continuous-run }} + uses: actions/checkout@v5 + with: + repository: abseil/abseil-cpp + path: abseil-cpp-head + - name: Run tests + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/abseil_head + bazel: test //src/... --override_module=abseil-cpp=abseil-cpp-head -# # Runs tests against unreleased Bazel HEAD (last_green) to catch regressions early. -# linux-bazel-last-green: -# name: ${{ inputs.continuous-prefix }} Linux Bazel last_green -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Run tests -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: cpp_linux/bazel_last_green -# bash: USE_BAZEL_VERSION=last_green bazelisk test //src/... //third_party/utf8_range/... --cxxopt=-Wno-self-assign-overloaded + # Runs tests against unreleased Bazel HEAD (last_green) to catch regressions early. + linux-bazel-last-green: + name: ${{ inputs.continuous-prefix }} Linux Bazel last_green + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Run tests + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.2.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: cpp_linux/bazel_last_green + bash: USE_BAZEL_VERSION=last_green bazelisk test //src/... //third_party/utf8_range/... --cxxopt=-Wno-self-assign-overloaded
diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 24d2930..c3cacdc 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml
@@ -23,51 +23,51 @@ contents: read jobs: -# linux: -# strategy: -# fail-fast: false # Don't cancel all jobs if one fails. -# matrix: -# type: [ Pure, C++] -# version: ["3.10", "3.11", "3.12", "3.13", "3.14"] -# include: -# - type: Pure -# targets: //python/... //python:python_version_test -# flags: --define=use_fast_cpp_protos=false -# - type: C++ -# targets: //python/... //python:python_version_test -# flags: --define=use_fast_cpp_protos=true -# # Test using WORKSPACE with our oldest support Python version. -# - version: "3.10" -# - version: "3.11" -# continuous-only: true -# - version: "3.12" -# continuous-only: true -# - version: "3.13" -# continuous-only: true -# - version: "3.14" -# - type: C++ -# 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:8.7.0-aarch64-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 -# -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.type }} ${{ matrix.version }} ${{ matrix.nobzlmod && 'No Bzlmod' || '' }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.version) }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }} -# bazel: test ${{ matrix.targets }} ${{ matrix.flags }} ${{ matrix.nobzlmod && '--noenable_bzlmod' || '' }} --test_env=KOKORO_PYTHON_VERSION + linux: + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + type: [ Pure, C++] + version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + include: + - type: Pure + targets: //python/... //python:python_version_test + flags: --define=use_fast_cpp_protos=false + - type: C++ + targets: //python/... //python:python_version_test + flags: --define=use_fast_cpp_protos=true + # Test using WORKSPACE with our oldest support Python version. + - version: "3.10" + - version: "3.11" + continuous-only: true + - version: "3.12" + continuous-only: true + - version: "3.13" + continuous-only: true + - version: "3.14" + - type: C++ + 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:8.7.0-aarch64-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 + + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.type }} ${{ matrix.version }} ${{ matrix.nobzlmod && 'No Bzlmod' || '' }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.version) }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }} + bazel: test ${{ matrix.targets }} ${{ matrix.flags }} ${{ matrix.nobzlmod && '--noenable_bzlmod' || '' }} --test_env=KOKORO_PYTHON_VERSION macos:
diff --git a/.github/workflows/test_ruby.yml b/.github/workflows/test_ruby.yml index 2dbeeeb..e017f7a 100644 --- a/.github/workflows/test_ruby.yml +++ b/.github/workflows/test_ruby.yml
@@ -23,116 +23,116 @@ contents: read jobs: -# linux: -# strategy: -# fail-fast: false -# matrix: -# include: -# # Test both FFI and Native implementations on the highest and lowest -# # Ruby versions for CRuby and JRuby -# - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: NATIVE } -# - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: FFI } -# - { name: Ruby 3.3, ruby: ruby-3.3.6, continuous-only: true } -# - { name: Ruby 3.4, ruby: ruby-3.4.1, continuous-only: true } -# - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: NATIVE } -# - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: FFI } -# - { name: Ruby 4.0 bazel 8, ruby: ruby-4.0.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: Ruby 4.0 bazel 8, ruby: ruby-4.4.4, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: NATIVE } -# - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: FFI } -# - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.name }} ${{ matrix.ffi == 'FFI' && ' FFI' || '' }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.ruby) }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: ruby_linux/${{ matrix.ruby }} -# bazel: test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION --test_env=BAZEL=true ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled --test_env=PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} -## Useful tool for troubleshooting, but the action introduces flakes as well, -## e.g. https://github.com/actions/upload-artifact/issues/569 -## - name: Archive log artifacts -## if: ${{ matrix.presubmit || inputs.test-type == 'continuous' }} -## uses: actions/upload-artifact@v6 -## with: -## name: test-logs-${{ matrix.ruby }}_${{ matrix.ffi || 'NATIVE' }} -## path: logs + linux: + strategy: + fail-fast: false + matrix: + include: + # Test both FFI and Native implementations on the highest and lowest + # Ruby versions for CRuby and JRuby + - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: NATIVE } + - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: FFI } + - { name: Ruby 3.3, ruby: ruby-3.3.6, continuous-only: true } + - { name: Ruby 3.4, ruby: ruby-3.4.1, continuous-only: true } + - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: NATIVE } + - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: FFI } + - { name: Ruby 4.0 bazel 8, ruby: ruby-4.0.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: Ruby 4.0 bazel 8, ruby: ruby-4.4.4, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: NATIVE } + - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: FFI } + - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# linux-32bit: -# name: Linux 32-bit -# runs-on: ubuntu-22-4core -# steps: -# - name: Checkout pending changes -# uses: protocolbuffers/protobuf-ci/checkout@v6 + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.name }} ${{ matrix.ffi == 'FFI' && ' FFI' || '' }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.ruby) }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: ruby_linux/${{ matrix.ruby }} + bazel: test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION --test_env=BAZEL=true ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled --test_env=PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} +# Useful tool for troubleshooting, but the action introduces flakes as well, +# e.g. https://github.com/actions/upload-artifact/issues/569 +# - name: Archive log artifacts +# if: ${{ matrix.presubmit || inputs.test-type == 'continuous' }} +# uses: actions/upload-artifact@v6 # with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Cross compile protoc for i386 -# id: cross-compile -# uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# architecture: linux-i386 -# -# - name: Run tests -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: i386/ruby:3.2.11-bookworm -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# command: >- -# /bin/bash -cex ' -# gem install bundler -v 2.6.6; -# cd /workspace/ruby; -# bundle; -# PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake; -# rake clobber_package gem; -# PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake test' +# name: test-logs-${{ matrix.ruby }}_${{ matrix.ffi || 'NATIVE' }} +# path: logs -# linux-aarch64: -# name: ${{ inputs.continuous-prefix || '' }} Linux aarch64 -# runs-on: ubuntu-22-4core -# steps: -# - name: Checkout pending changes -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# -# - name: Cross compile protoc for aarch64 -# if: ${{ inputs.continuous-run }} -# id: cross-compile -# uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 -# with: -# image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# architecture: linux-aarch64 -# -# - name: Run tests -# if: ${{ inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/docker@v6 -# with: -# image: ruby:3.2.11-bookworm -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# platform: linux/arm64 -# command: >- -# /bin/bash -cex ' -# gem install bundler -v 2.6.6; -# cd /workspace/ruby; -# bundle; -# PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake; -# rake clobber_package gem; -# PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake test' + linux-32bit: + name: Linux 32-bit + runs-on: ubuntu-22-4core + steps: + - name: Checkout pending changes + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Cross compile protoc for i386 + id: cross-compile + uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + architecture: linux-i386 + + - name: Run tests + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: i386/ruby:3.2.11-bookworm + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + command: >- + /bin/bash -cex ' + gem install bundler -v 2.6.6; + cd /workspace/ruby; + bundle; + PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake; + rake clobber_package gem; + PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake test' + + linux-aarch64: + name: ${{ inputs.continuous-prefix || '' }} Linux aarch64 + runs-on: ubuntu-22-4core + steps: + - name: Checkout pending changes + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + + - name: Cross compile protoc for aarch64 + if: ${{ inputs.continuous-run }} + id: cross-compile + uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v6 + with: + image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.7.0-4d8e80ef93b0219fb907af9dd4596b92946995d8 + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + architecture: linux-aarch64 + + - name: Run tests + if: ${{ inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/docker@v6 + with: + image: ruby:3.2.11-bookworm + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + platform: linux/arm64 + command: >- + /bin/bash -cex ' + gem install bundler -v 2.6.6; + cd /workspace/ruby; + bundle; + PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake; + rake clobber_package gem; + PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake test' macos: strategy: @@ -178,49 +178,49 @@ bazel-cache: ruby_macos/${{ matrix.version }} bazel: test //ruby/... --test_env=KOKORO_RUBY_VERSION=${{ matrix.version }} --test_env=BAZEL=true ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled --test_env=PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} -# # This test should always be skipped on presubmit -# test_ruby_gems: -# strategy: -# fail-fast: false -# matrix: -# include: -# # Test both FFI and Native implementations on the highest and lowest -# # Ruby versions for CRuby and JRuby. -# - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: NATIVE } -# - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: FFI } -# - { name: Ruby 3.3, ruby: ruby-3.3.6, continuous-only: true } -# - { name: Ruby 3.4, ruby: ruby-3.4.1, continuous-only: true } -# - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: NATIVE } -# - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: FFI } -# - { name: Ruby 4.0 bazel 8, ruby: ruby-4.0.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: Ruby 4.0 bazel 8, ruby: ruby-4.4.4, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: NATIVE } -# - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: FFI, continuous-only: true } -# - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } -# name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Install ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }} -# runs-on: ubuntu-latest -# steps: -# - name: Checkout pending changes -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/checkout@v6 -# with: -# ref: ${{ inputs.safe-checkout }} -# - name: Run tests -# if: ${{ !matrix.continuous-only || inputs.continuous-run }} -# uses: protocolbuffers/protobuf-ci/bazel-docker@v6 -# with: -# image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.ruby) }} -# credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} -# bazel-cache: ruby_install/${{ matrix.ruby }}_${{ matrix.bazel }} -# bash: > -# bazel --version; -# ruby --version; -# ./regenerate_stale_files.sh $BAZEL_FLAGS; -# # TODO: Add --action_env=PATH to release builds before upgrade them to Bazel 9 -# bazel build //ruby:release //:protoc ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled' || '' }} --action_env=PATH $BAZEL_FLAGS; -# gem install bazel-bin/ruby/google-protobuf-*; -# bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/test_import_proto2.proto; -# bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/basic_test.proto; -# ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/basic.rb; -# ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/implementation.rb + # This test should always be skipped on presubmit + test_ruby_gems: + strategy: + fail-fast: false + matrix: + include: + # Test both FFI and Native implementations on the highest and lowest + # Ruby versions for CRuby and JRuby. + - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: NATIVE } + - { name: Ruby 3.2, ruby: ruby-3.2.6, ffi: FFI } + - { name: Ruby 3.3, ruby: ruby-3.3.6, continuous-only: true } + - { name: Ruby 3.4, ruby: ruby-3.4.1, continuous-only: true } + - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: NATIVE } + - { name: Ruby 4.0, ruby: ruby-4.0.0, ffi: FFI } + - { name: Ruby 4.0 bazel 8, ruby: ruby-4.0.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: Ruby 4.0 bazel 8, ruby: ruby-4.4.4, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-ruby-4.0.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: NATIVE } + - { name: JRuby 9.4, ruby: jruby-9.4.9.0, ffi: FFI, continuous-only: true } + - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: NATIVE, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + - { name: JRuby 9.4 bazel 8, ruby: jruby-9.4.9.0, ffi: FFI, image: 'us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:8.7.0-jruby-9.4.9.0-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ' } + name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Install ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }} + runs-on: ubuntu-latest + steps: + - name: Checkout pending changes + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/checkout@v6 + with: + ref: ${{ inputs.safe-checkout }} + - name: Run tests + if: ${{ !matrix.continuous-only || inputs.continuous-run }} + uses: protocolbuffers/protobuf-ci/bazel-docker@v6 + with: + image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:9.2.0-{0}-5bb1a8fdfc30f8c21c1b38cf053d2db9fca865a7 ', matrix.ruby) }} + credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} + bazel-cache: ruby_install/${{ matrix.ruby }}_${{ matrix.bazel }} + bash: > + bazel --version; + ruby --version; + ./regenerate_stale_files.sh $BAZEL_FLAGS; + # TODO: Add --action_env=PATH to release builds before upgrade them to Bazel 9 + bazel build //ruby:release //:protoc ${{ matrix.ffi == 'FFI' && '--//ruby:ffi=enabled' || '' }} --action_env=PATH $BAZEL_FLAGS; + gem install bazel-bin/ruby/google-protobuf-*; + bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/test_import_proto2.proto; + bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/basic_test.proto; + ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/basic.rb; + ${{ matrix.ffi == 'FFI' && 'PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION=FFI' || '' }} ruby ruby/tests/implementation.rb
diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml index 481f347..720eb82 100644 --- a/.github/workflows/test_runner.yml +++ b/.github/workflows/test_runner.yml
@@ -150,15 +150,15 @@ continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} secrets: inherit -# java: -# name: Java -# needs: [set-vars] -# uses: ./.github/workflows/test_java.yml -# with: -# continuous-run: ${{ needs.set-vars.outputs.continuous-run }} -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} -# secrets: inherit + java: + name: Java + needs: [set-vars] + uses: ./.github/workflows/test_java.yml + with: + continuous-run: ${{ needs.set-vars.outputs.continuous-run }} + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} + secrets: inherit python: name: Python @@ -180,33 +180,33 @@ continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} secrets: inherit -# php: -# name: PHP -# needs: [set-vars] -# uses: ./.github/workflows/test_php.yml -# with: -# continuous-run: ${{ needs.set-vars.outputs.continuous-run }} -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} -# secrets: inherit -# -# php-ext: -# name: PHP Extension -# needs: [set-vars] -# uses: ./.github/workflows/test_php_ext.yml -# with: -# continuous-run: ${{ needs.set-vars.outputs.continuous-run }} -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} -# secrets: inherit -# -# csharp: -# name: C# -# needs: [set-vars] -# uses: ./.github/workflows/test_csharp.yml -# with: -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# secrets: inherit + php: + name: PHP + needs: [set-vars] + uses: ./.github/workflows/test_php.yml + with: + continuous-run: ${{ needs.set-vars.outputs.continuous-run }} + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} + secrets: inherit + + php-ext: + name: PHP Extension + needs: [set-vars] + uses: ./.github/workflows/test_php_ext.yml + with: + continuous-run: ${{ needs.set-vars.outputs.continuous-run }} + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} + secrets: inherit + + csharp: + name: C# + needs: [set-vars] + uses: ./.github/workflows/test_csharp.yml + with: + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + secrets: inherit objectivec: name: Objective-C @@ -218,13 +218,13 @@ continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} secrets: inherit -# rust: -# name: Rust -# needs: [set-vars] -# uses: ./.github/workflows/test_rust.yml -# with: -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# secrets: inherit + rust: + name: Rust + needs: [set-vars] + uses: ./.github/workflows/test_rust.yml + with: + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + secrets: inherit upb: name: μpb @@ -236,13 +236,13 @@ continuous-prefix: ${{ needs.set-vars.outputs.continuous-prefix }} secrets: inherit -# hpb: -# name: hpb -# needs: [set-vars] -# uses: ./.github/workflows/test_hpb.yml -# with: -# safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} -# secrets: inherit + hpb: + name: hpb + needs: [set-vars] + uses: ./.github/workflows/test_hpb.yml + with: + safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }} + secrets: inherit staleness: name: Staleness @@ -258,22 +258,7 @@ # This test depends on all blocking tests and indicates whether they all suceeded. all-blocking-tests: name: All Blocking Tests${{ github.event_name == 'pull_request_target' && ' (fork)' || ''}} - needs: [ - set-vars, - validate-yaml, - bazel, - cpp, -# java, - python, - ruby, -# php, -# php-ext, -# csharp, - objectivec, -# rust, - upb, -# hpb, - staleness] + needs: [set-vars, validate-yaml, bazel, cpp, java, python, ruby, php, php-ext, csharp, objectivec, rust, upb, hpb, staleness] runs-on: ubuntu-latest steps: - name: Check test results