Merge with main
diff --git a/.github/workflows/staleness_check.yml b/.github/workflows/staleness_check.yml
index 9fc9480..d5c1a65 100644
--- a/.github/workflows/staleness_check.yml
+++ b/.github/workflows/staleness_check.yml
@@ -6,6 +6,11 @@
- cron: 0 10 * * *
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: false
description: "The SHA key for the commit we want to run over"
@@ -20,15 +25,20 @@
matrix:
branch: [main, 25.x, 27.x, 28.x]
os: [{ name: Linux, value: ubuntu-latest}]
+ exclude:
+ # If we are in a presubmit run, only test main
+ - branch: ${{ !inputs.continuous-run && '25.x' }}
+ - branch: ${{ !inputs.continuous-run && '27.x' }}
+ - branch: ${{ !inputs.continuous-run && '28.x' }}
- name: Test staleness ${{ matrix.os.name }} ${{ github.head_ref && 'PR' || matrix.branch }}
+ name: Test staleness ${{ matrix.os.name }} ${{ matrix.branch }}
runs-on: ${{ matrix.os.value }}
if: ${{ github.event.repository.full_name == 'protocolbuffers/protobuf' }}
steps:
- - name: Checkout ${{ github.head_ref && 'PR' || matrix.branch }}
+ - name: Checkout ${{ matrix.branch }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
- ref: ${{ inputs.safe-checkout || github.head_ref || matrix.branch }}
+ ref: ${{ inputs.safe-checkout || matrix.branch }}
- name: Mark runs associated with commits
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
diff --git a/.github/workflows/test_bazel.yml b/.github/workflows/test_bazel.yml
index a61c662..a7e1ed3 100644
--- a/.github/workflows/test_bazel.yml
+++ b/.github/workflows/test_bazel.yml
@@ -3,10 +3,19 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
permissions:
contents: read
@@ -19,31 +28,36 @@
runner: [ ubuntu, windows, macos ]
bazelversion: [ '7.1.2' ]
bzlmod: [true, false ]
+ continuous-only: [ false ]
include:
- runner: ubuntu
bazelversion: '6.4.0'
# Not running Bazel 6 with bzlmod, because it doesn't support use_repo_rule in rules_jvm_external
bzlmod: false
+ continuous-only: true
runs-on: ${{ matrix.runner }}-latest
- name: Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }}
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Examples ${{ matrix.runner }} ${{ matrix.bazelversion }}${{ matrix.bzlmod && ' (bzlmod)' || '' }}
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Windows startup flags
- if: runner.os == 'Windows'
+ 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@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml
index 4b36b56..b1e2096 100644
--- a/.github/workflows/test_cpp.yml
+++ b/.github/workflows/test_cpp.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -18,12 +28,12 @@
matrix:
config:
- { name: Optimized, flags: --config=opt }
- - { name: Debug, flags: --config=dbg }
+ - { 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 }
- - { name: TSAN, flags: --config=tsan, runner: ubuntu-22-4core }
- - { name: UBSAN, flags: --config=ubsan }
- - { name: No-RTTI, flags: --cxxopt=-fno-rtti }
+ - { 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, 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@sha256:3d959f731dc5c54af4865c31ee2bd581ec40028adcdf4c038f3122581f595191
@@ -46,14 +56,16 @@
cache_key: TcMalloc
targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test //third_party/utf8_range/..."
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:6.3.0-aarch64-68e662b3a56b881804dc4e9d45f949791cbc4b94"
- name: Linux ${{ matrix.config.name }}
+ 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@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
+ if: ${{ !matrix.config.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: ${{ matrix.image }}
@@ -129,31 +141,38 @@
matrix:
include:
- flags: -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=14
+ continuous-only: false
- name: Ninja
flags: -G Ninja -DCMAKE_CXX_STANDARD=14
+ continuous-only: true
- name: Shared
flags: -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_EXAMPLES=ON -DCMAKE_CXX_STANDARD=14
+ continuous-only: true
- name: C++17
flags: -DCMAKE_CXX_STANDARD=17
+ continuous-only: false
# TODO Re-enable this.
#- name: C++20
# flags: -DCMAKE_CXX_STANDARD=20
- name: Linux CMake ${{ matrix.name}}
+ 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@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Setup sccache
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/sccache@v3
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@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.13.3-63dd26c0c7a808d92673a3e52e848189d4ab0f17
@@ -198,6 +217,8 @@
linux-cmake-examples:
name: Linux CMake Examples
+ # Skip this test on presubmit
+ if: ${{ inputs.continuous-run }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
@@ -232,27 +253,33 @@
include:
- name: C++14
flags: -DCMAKE_CXX_STANDARD=14
+ continuous-only: false
- name: C++17
flags: -DCMAKE_CXX_STANDARD=17
+ continuous-only: true
- name: C++20
flags: -DCMAKE_CXX_STANDARD=20
+ continuous-only: false
- name: Linux CMake GCC ${{ matrix.name }}
+ 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@v3
with:
ref: ${{ inputs.safe-checkout }}
submodules: recursive
- name: Setup sccache
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/sccache@v3
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@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-63dd26c0c7a808d92673a3e52e848189d4ab0f17
@@ -332,34 +359,41 @@
os: macos-12
cache_key: macos-12
bazel: test //src/... //third_party/utf8_range/...
+ continuous-only: false
- name: MacOS Bazel 7
os: macos-12
cache_key: macos-12-bazel7
bazel: test //src/... //third_party/utf8_range/...
bazel_version: '7.1.2'
+ continuous-only: true
- name: MacOS Apple Silicon (build only) Bazel
os: macos-12
cache_key: macos-12-arm
# Current github runners are all Intel based, so just build/compile
# for Apple Silicon to detect issues there.
bazel: build --cpu=darwin_arm64 //src/... //third_party/utf8_range/...
+ continuous-only: false
- name: Windows Bazel
os: windows-2022
cache_key: windows-2022
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
+ continuous-only: false
- name: Windows Bazel 7
os: windows-2022
cache_key: windows-2022-bazel7
bazel: test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
bazel_version: '7.1.2'
- name: ${{ matrix.name }}
+ continuous-only: true
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
@@ -385,6 +419,7 @@
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2022'
cache-prefix: windows-2022-cmake
+ continuous-only: true
- name: Windows CMake 2019
os: windows-2019
flags: >-
@@ -395,6 +430,7 @@
cache-prefix: windows-2019-cmake
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.9'
+ continuous-only: true
- name: Windows CMake 32-bit
os: windows-2022
flags: >-
@@ -402,6 +438,7 @@
vsversion: '2022'
windows-arch: 'win32'
cache-prefix: windows-2022-win32-cmake
+ continuous-only: true
- name: Windows CMake Shared
os: windows-2022
flags: >-
@@ -409,6 +446,7 @@
-Dprotobuf_BUILD_SHARED_LIBS=ON
vsversion: '2022'
cache-prefix: windows-2022-cmake
+ continuous-only: false
- name: Windows CMake Install
os: windows-2022
install-flags: -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
@@ -418,17 +456,19 @@
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
vsversion: '2022'
cache-prefix: windows-2022-cmake
- name: ${{ matrix.name }}
+ continuous-only: true
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout pending changes
+ if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
submodules: recursive
- name: Setup MSVC
- if: ${{ runner.os == 'Windows' }}
+ if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }}
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1
with:
arch: ${{ matrix.windows-arch || 'x64' }}
@@ -442,16 +482,17 @@
# Workaround for incompatibility between gcloud and windows-2019 runners.
- name: Install Python
- if: ${{ matrix.python-version }}
+ if: ${{ matrix.python-version && (!matrix.continuous-only || inputs.continuous-run) }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Use custom python for gcloud
- if: ${{ matrix.python-version }}
+ if: ${{ matrix.python-version && (!matrix.continuous-only || inputs.continuous-run) }}
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
shell: bash
- name: Setup sccache
+ if: ${{ runner.os == 'Windows' && (!matrix.continuous-only || inputs.continuous-run) }}
uses: protocolbuffers/protobuf-ci/sccache@v3
with:
cache-prefix: ${{ matrix.cache-prefix }}
@@ -459,42 +500,46 @@
# Install phase.
- name: Configure CMake for install
- if: matrix.install-flags
+ if: ${{ matrix.install-flags && (!matrix.continuous-only || inputs.continuous-run) }}
uses: protocolbuffers/protobuf-ci/bash@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: cmake . ${{ matrix.install-flags }} ${{ env.SCCACHE_CMAKE_FLAGS }} -Dprotobuf_ALLOW_CCACHE=ON
- name: Build for install
- if: matrix.install-flags
+ if: ${{ matrix.install-flags && (!matrix.continuous-only || inputs.continuous-run) }}
shell: bash
run: VERBOSE=1 cmake --build . --parallel 20
- name: Install
- if: matrix.install-flags
+ if: ${{ matrix.install-flags && (!matrix.continuous-only || inputs.continuous-run) }}
shell: bash
run: cmake --build . --target install
- name: Report and clear sccache stats
- if: matrix.install-flags
+ if: ${{ matrix.install-flags && (!matrix.continuous-only || inputs.continuous-run) }}
shell: bash
run: sccache -s && sccache -z
- name: Clear CMake cache
- if: matrix.install-flags
+ if: ${{ matrix.install-flags && (!matrix.continuous-only || inputs.continuous-run) }}
shell: bash
run: cmake --build . --target clean && rm CMakeCache.txt
- name: Configure CMake
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bash@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: cmake . ${{ matrix.flags }} ${{ env.SCCACHE_CMAKE_FLAGS }} -Dprotobuf_ALLOW_CCACHE=ON
- name: Build
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
shell: bash
run: VERBOSE=1 cmake --build . --parallel 20
- name: Test
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
shell: bash
run: ctest --verbose --parallel 20 -C Debug
- name: Report sccache stats
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
shell: bash
run: sccache -s
diff --git a/.github/workflows/test_csharp.yml b/.github/workflows/test_csharp.yml
index 8b04ff4..ae0b76d 100644
--- a/.github/workflows/test_csharp.yml
+++ b/.github/workflows/test_csharp.yml
@@ -12,6 +12,8 @@
contents: read
jobs:
+ # All C# jobs are currently run on presubmit
+ # If you wish to add continuous-only jobs you will need to import test-type above
linux:
name: Linux
runs-on: ubuntu-latest
diff --git a/.github/workflows/test_java.yml b/.github/workflows/test_java.yml
index 189e5c2..96c778c 100644
--- a/.github/workflows/test_java.yml
+++ b/.github/workflows/test_java.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -23,14 +33,17 @@
# 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
+ continuous-only: true
- name: OpenJDK 11
cache_key: '11'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
targets: //java/... //java/internal:java_version //compatibility/...
+ continuous-only: true
- name: OpenJDK 17
cache_key: '17'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:17-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
targets: //java/... //java/internal:java_version //compatibility/...
+ continuous-only: false
- name: Bazel7
cache_key: 'bazel7nobzlmod'
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-cf84e92285ca133b9c8104ad7b14d70e953cbb8e
@@ -45,16 +58,19 @@
cache_key: 'aarch64'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-63dd26c0c7a808d92673a3e52e848189d4ab0f17
targets: //java/... //compatibility/... //src/google/protobuf/compiler:protoc_aarch64_test
+ continuous-only: false
- name: Linux ${{ matrix.name }}
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
with:
image: ${{ matrix.image }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
@@ -79,7 +95,7 @@
# # TODO: b/318555165 - enable the layering check. Currently it does
# # not work correctly with the toolchain in this Docker image.
# bazel: test --test_output=all //java:linkage_monitor --spawn_strategy=standalone --features=-layering_check
-
+
protobuf-bom:
name: Protobuf Maven BOM
runs-on: ubuntu-latest
diff --git a/.github/workflows/test_objectivec.yml b/.github/workflows/test_objectivec.yml
index 1db6c10..a6694a4 100644
--- a/.github/workflows/test_objectivec.yml
+++ b/.github/workflows/test_objectivec.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -27,24 +37,32 @@
- platform: "iOS"
destination: "platform=iOS Simulator,name=iPhone 13,OS=latest"
xc_project: "ProtocolBuffers_iOS.xcodeproj"
+ # We run presubmits on all "Debug" entries, but not on "Release" entries
+ - xc_config: "Debug"
+ continuous-only: false
+ - xc_config: "Release"
+ continuous-only: true
- name: Xcode ${{ matrix.platform}} ${{ matrix.xc_config }}
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Xcode ${{ matrix.platform}} ${{ matrix.xc_config }}
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Setup ccache
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/ccache@v3
with:
cache-prefix: objectivec_${{ matrix.platform }}_${{ matrix.xc_config }}
support-modules: true
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bash@v3
env:
CC: ${{ github.workspace }}/ci/clang_wrapper
@@ -61,6 +79,7 @@
| xcpretty
- name: Report ccache stats
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
shell: bash
run: ccache -s -v
@@ -76,16 +95,24 @@
- OS: macos-14
PLATFORM: "visionos"
XCODE: "15.2"
- name: CocoaPods ${{ matrix.PLATFORM }} ${{ matrix.CONFIGURATION }}
+ # We run presubmits on all "Debug" entries, but not on "Release" entries
+ - CONFIGURATION: "Debug"
+ continuous-only: false
+ - CONFIGURATION: "Release"
+ continuous-only: true
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} CocoaPods ${{ matrix.PLATFORM }} ${{ matrix.CONFIGURATION }}
runs-on: ${{ matrix.OS }}
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Xcode version
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.XCODE }}.app
- name: Pod lib lint
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
@@ -105,30 +132,36 @@
- name: Optimized
flags: --config=opt
bazel_action: test
+ continuous-only: true
- name: Debug
flags: --config=dbg
bazel_action: test
+ continuous-only: false
# Current github runners are all Intel based, so just build/compile
# for Apple Silicon to detect issues there.
- name: Apple_Silicon_Optimized
flags: --config=opt --cpu=darwin_arm64
bazel_action: build
+ continuous-only: true
- name: Apple_Silicon_Debug
flags: --config=dbg --cpu=darwin_arm64
bazel_action: build
+ continuous-only: false
# TODO: Could add iOS to atleast build the objc_library targets for that.
platform: ["macOS"]
include:
- platform: "macOS"
bazel_targets: //objectivec/...
- name: Bazel ${{ matrix.platform }} ${{ matrix.config.name }}
+ name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} Bazel ${{ matrix.platform }} ${{ matrix.config.name }}
runs-on: macos-12
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.config.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: bazel ${{ matrix.config.bazel_action }}
+ if: ${{ !matrix.config.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
diff --git a/.github/workflows/test_php.yml b/.github/workflows/test_php.yml
index 86d2495..dea9c08 100644
--- a/.github/workflows/test_php.yml
+++ b/.github/workflows/test_php.yml
@@ -4,10 +4,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -22,37 +32,45 @@
version: "8.1.14"
version-short: "8.1"
command: composer test \&\& composer test_c
+ presubmit: true
- name: 8.1 Debug
version: 8.1.14-dbg
version-short: "8.1"
command: composer test \&\& composer test_c
+ presubmit: false
- name: 8.1 Memory Leak
version: 8.1.14-dbg
version-short: "8.1"
# Run specialized memory leak & multirequest tests.
command: composer test_c \&\& tests/multirequest.sh \&\& tests/memory_leak_test.sh
+ presubmit: false
- name: 8.1 Valgrind
version: 8.1.14-dbg
version-short: "8.1"
command: composer test_valgrind
+ presubmit: false
- name: 8.3 Optimized
version: "8.3.1"
version-short: "8.3"
command: composer test \&\& composer test_c
+ presubmit: true
- name: Linux ${{ matrix.name}}
+ name: ${{ !matrix.presubmit && inputs.continuous-prefix || '' }} Linux ${{ matrix.name}}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Setup composer
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version-short }}
directory: php
- name: Run tests
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.version }}-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea
@@ -73,20 +91,27 @@
include:
- suffix: '-zts'
suffix_name: ' Thread Safe'
+ presubmit: false
- test: 'test_c'
test_name: ' Extension'
+ presubmit: false
+ - suffix: ''
+ test: 'test'
+ presubmit: true
- name: Linux 32-bit ${{ matrix.version}}${{ matrix.suffix_name }}${{ matrix.test_name }}
+ name: ${{ !matrix.presubmit && inputs.continuous-prefix || '' }} Linux 32-bit ${{ matrix.version}}${{ matrix.suffix_name }}${{ matrix.test_name }}
runs-on: ubuntu-latest
env:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:836f2cedcfe351d9a30055076630408e61994fc7d783e8333a99570968990eeb
steps:
- name: Checkout pending changes
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Cross compile protoc for i386
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
with:
@@ -95,12 +120,14 @@
architecture: linux-i386
- name: Setup composer
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: ${{ env.image }}
@@ -155,37 +182,48 @@
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
- version: ['8.2', '8.3']
+ include:
+ - version: '8.2'
+ presubmit: false
+ - version: '8.3'
+ presubmit: true
- name: MacOS PHP ${{ matrix.version }}
+ name: ${{ !matrix.presubmit && inputs.continuous-prefix || '' }} MacOS PHP ${{ matrix.version }}
runs-on: macos-12
steps:
- name: Checkout pending changes
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Uninstall problematic libgd
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
run: brew uninstall --ignore-dependencies gd
- name: Install dependencies
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
run: brew install coreutils gd
- name: Pin PHP version
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033 # 2.30.2
with:
php-version: ${{ matrix.version }}
- name: Check PHP version
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
run: php --version | grep ${{ matrix.version }} || (echo "Invalid PHP version - $(php --version)" && exit 1)
- name: Setup composer
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bash@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
@@ -198,6 +236,7 @@
popd
- name: Run conformance tests
+ if: ${{ matrix.presubmit || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
diff --git a/.github/workflows/test_php_ext.yml b/.github/workflows/test_php_ext.yml
index dfe1951..826e3fd 100644
--- a/.github/workflows/test_php_ext.yml
+++ b/.github/workflows/test_php_ext.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read # to fetch code (actions/checkout)
@@ -41,15 +51,23 @@
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
- version: ["8.1", "8.2", "8.3"]
- name: Build ${{ matrix.version }}
+ include:
+ - version: "8.1"
+ continuous-only: true
+ - version: "8.2"
+ continuous-only: true
+ - version: "8.3"
+ continuous-only: false
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Build ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
with:
name: protobuf-php-release
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-extension:${{ matrix.version }}-a48f26c08d9a803dd0177dda63563f6ea6f7b2d4
diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml
index b48da36..03b018f 100644
--- a/.github/workflows/test_python.yml
+++ b/.github/workflows/test_python.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -32,15 +42,26 @@
# 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
+ continuous-only: false
+ - version: "3.8"
+ continuous-only: false
+ - version: "3.9"
+ continuous-only: true
+ - version: "3.10"
+ continuous-only: true
+ - version: "3.11"
+ continuous-only: false
- name: Linux ${{ matrix.type }} ${{ matrix.version }}
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.type }} ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-63dd26c0c7a808d92673a3e52e848189d4ab0f17', matrix.version) }}
diff --git a/.github/workflows/test_ruby.yml b/.github/workflows/test_ruby.yml
index 8d75418..ebb0816 100644
--- a/.github/workflows/test_ruby.yml
+++ b/.github/workflows/test_ruby.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -20,22 +30,24 @@
# Test both FFI and Native implementations on the highest and lowest
# Ruby versions for CRuby and JRuby, but only on Bazel 5.x.
- { name: Ruby 3.0, ruby: ruby-3.0.2, ffi: NATIVE }
- - { name: Ruby 3.0, ruby: ruby-3.0.2, ffi: FFI }
- - { name: Ruby 3.1, ruby: ruby-3.1.0 }
- - { name: Ruby 3.2, ruby: ruby-3.2.0 }
+ - { name: Ruby 3.0, ruby: ruby-3.0.2, ffi: FFI, continuous-only: true }
+ - { name: Ruby 3.1, ruby: ruby-3.1.0, continuous-only: true }
+ - { name: Ruby 3.2, ruby: ruby-3.2.0, continuous-only: true }
- { name: Ruby 3.3, ruby: ruby-3.3.0, ffi: NATIVE }
- - { name: Ruby 3.3, ruby: ruby-3.3.0, ffi: FFI }
+ - { name: Ruby 3.3, ruby: ruby-3.3.0, ffi: FFI, continuous-only: true }
- { name: JRuby 9.4, ruby: jruby-9.4.6.0, ffi: NATIVE }
- - { name: JRuby 9.4, ruby: jruby-9.4.6.0, ffi: FFI }
+ - { name: JRuby 9.4, ruby: jruby-9.4.6.0, ffi: FFI, continuous-only: true }
- name: Linux ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
+ 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@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:{0}-6.3.0-9848710ff1370795ee7517570a20b81e140112ec', matrix.ruby) }}
@@ -45,6 +57,7 @@
# 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@v4
# with:
# name: test-logs-${{ matrix.ruby }}_${{ matrix.ffi || 'NATIVE' }}
@@ -121,29 +134,33 @@
# Ruby versions for CRuby, but only on Bazel 5.x.
# Quote versions numbers otherwise 3.0 will render as 3
- { version: "3.0", ffi: NATIVE }
- - { version: "3.0", ffi: FFI }
- - { version: "3.1" }
- - { version: "3.2" }
+ - { version: "3.0", ffi: FFI, continuous-only: true }
+ - { version: "3.1", continuous-only: true }
+ - { version: "3.2", continuous-only: true }
- { version: "3.3", ffi: NATIVE }
- - { version: "3.3", ffi: FFI }
+ - { version: "3.3", ffi: FFI, continuous-only: true }
- name: MacOS Ruby ${{ matrix.version }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} MacOS Ruby ${{ matrix.version }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
runs-on: macos-12
steps:
- name: Checkout pending changes
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Pin Ruby version
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: ruby/setup-ruby@961f85197f92e4842e3cb92a4f97bd8e010cdbaf # v1.165.0
with:
ruby-version: ${{ matrix.version }}
- name: Validate version
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: ruby --version | grep ${{ matrix.version }} || (echo "Invalid Ruby version - $(ruby --version)" && exit 1)
- name: Run tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
@@ -165,7 +182,9 @@
- { name: Ruby 3.3, ruby: ruby-3.3.0, ffi: FFI }
- { name: JRuby 9.4, ruby: jruby-9.4.6.0, ffi: NATIVE }
- { name: JRuby 9.4, ruby: jruby-9.4.6.0, ffi: FFI }
- name: Install ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }}
+ name: Install ${{ matrix.name }}${{ matrix.ffi == 'FFI' && ' FFI' || '' }} (Continuous)
+ # None of these ruby gem tests should be run on presubmit
+ if: ${{ inputs.continuous-run }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml
index 70cfc27..018fcd5 100644
--- a/.github/workflows/test_runner.yml
+++ b/.github/workflows/test_runner.yml
@@ -48,7 +48,7 @@
# manual
workflow_dispatch:
-
+
permissions:
contents: read
@@ -57,8 +57,8 @@
cancel-in-progress: ${{ contains(fromJSON('["pull_request", "pull_request_target", "workflow_dispatch"]'), github.event_name) }}
jobs:
- check-tag:
- name: Check for Safety
+ set-vars:
+ name: Set Variables
# Avoid running tests twice on PR updates. If the PR is coming from our
# repository, it's safe and we can use `pull_request`. Otherwise, we should
@@ -77,6 +77,15 @@
# Store the sha for checkout so we can easily use it later. For safe
# events, this will be blank and use the defaults.
checkout-sha: ${{ steps.safe-checkout.outputs.sha }}
+ # Stores a string to be used as a boolean denoting whether this is a
+ # continuous run. An empty string denotes that the run is on presubmit,
+ # otherwise we are in a continuous run. This helps us determine which
+ # tests to block on.
+ continuous-run: ${{ steps.set-test-type-vars.outputs.continuous-run }}
+ # Stores a string that will serve as the prefix for all continuous tests.
+ # Either way we prepend "(Continuous)" but in the case that we are in
+ # a presubmit run, we should also mark them "[SKIPPED]"
+ continuous-prefix: ${{ steps.set-test-type-vars.outputs.continuous-prefix }}
steps:
- name: Check
# Trivially pass for safe PRs, and explicitly error for unsafe ones
@@ -93,9 +102,20 @@
${{ github.event_name != 'pull_request_target' }} ||
echo "sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
+ - name: Set Test Type Variables
+ id: set-test-type-vars
+ run: |
+ if [ "${{ github.event_name }}" == 'pull_request' ] || [ "${{ github.event_name }}" == 'pull_request_target' ]; then
+ echo "continuous-run=" >> "$GITHUB_OUTPUT"
+ echo "continuous-prefix=[SKIPPED] (Continuous)" >> "$GITHUB_OUTPUT"
+ else
+ echo "continuous-run=continuous" >> "$GITHUB_OUTPUT"
+ echo "continuous-prefix=(Continuous)" >> "$GITHUB_OUTPUT"
+ fi
+
remove-tag:
name: Remove safety tag
- needs: [check-tag]
+ needs: [set-vars]
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
permissions:
@@ -111,98 +131,129 @@
# human stamp before continuing.
bazel:
name: Bazel
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_bazel.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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
cpp:
name: C++
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_cpp.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_java.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_python.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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
ruby:
name: Ruby
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_ruby.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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:
name: PHP
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_php.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_php_ext.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_csharp.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }}
secrets: inherit
objectivec:
name: Objective-C
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_objectivec.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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
rust:
name: Rust
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_rust.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }}
secrets: inherit
upb:
name: μpb
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/test_upb.yml
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ 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
staleness:
name: Staleness
- needs: [check-tag]
+ needs: [set-vars]
uses: ./.github/workflows/staleness_check.yml
# Staleness tests have scheduled runs during off-hours to avoid race conditions.
if: ${{ github.event_name != 'schedule' }}
with:
- safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }}
+ continuous-run: ${{ needs.set-vars.outputs.continuous-run }}
+ safe-checkout: ${{ needs.set-vars.outputs.checkout-sha }}
secrets: inherit
+
+ # This test depends on all blocking tests and indicates whether they all suceeded.
+ all_blocking_tests:
+ name: All Blocking Tests
+ needs: [set-vars, bazel, cpp, java, python, ruby, php, php-ext, csharp, objectivec, rust, upb, staleness]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check test results
+ run: "${{ !contains(join(needs.*.result, ' '), 'failure') && !contains(join(needs.*.result, ' '), 'cancelled') }}"
+ # This workflow must run even if one or more of the dependent workflows
+ # failed.
+ if: always() && ${{ needs.check-tag.result != 'skipped' }}
diff --git a/.github/workflows/test_rust.yml b/.github/workflows/test_rust.yml
index 00c2e4b..ea1f024 100644
--- a/.github/workflows/test_rust.yml
+++ b/.github/workflows/test_rust.yml
@@ -12,6 +12,7 @@
contents: read
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
runs-on: ubuntu-latest
diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml
index 945b7c0..dc054ef 100644
--- a/.github/workflows/test_upb.yml
+++ b/.github/workflows/test_upb.yml
@@ -3,10 +3,20 @@
on:
workflow_call:
inputs:
+ continuous-run:
+ required: true
+ description: "Boolean string denoting whether this run is continuous --
+ empty string for presubmit, non-empty string for continuous."
+ type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
+ continuous-prefix:
+ required: true
+ description: "The prefix for tests that should only be run continuously"
+ type: string
+
permissions:
contents: read
@@ -17,24 +27,26 @@
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
config:
- - { name: "Bazel 7", bazel_version: "7.1.1" }
+ - { name: "Bazel 7", bazel_version: "7.1.1", continuous-only: true }
- { name: "Fastbuild" }
- - { name: "Optimized", flags: "-c opt" }
+ - { name: "Optimized", flags: "-c opt", continuous-only: true }
- { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/...", runner: ubuntu-22-4core }
- - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/... -//lua/..." }
+ - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/... -//lua/...", continuous-only: true }
- { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//benchmarks:benchmark -//python/..." }
# TODO: Add 32-bit ASAN test
# TODO: Restore the FastTable tests
- name: ${{ matrix.config.name }}
+ name: ${{ matrix.config.continuous-only && inputs.continuous-prefix || '' }} ${{ 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@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
+ if: ${{ !matrix.config.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel-docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-75f2a85ece6526cc3d54087018c0f1097d78d42b
@@ -161,8 +173,6 @@
path: python/requirements.txt
test_wheels:
- name: Test Wheels
- needs: build_wheels
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
@@ -175,22 +185,24 @@
- { os: macos-12, python-version: "3.8", architecture: x64, type: 'binary' }
- { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'binary' }
- { os: macos-13, python-version: "3.12", architecture: x64, type: 'binary' }
- - { os: ubuntu-latest, python-version: "3.8", architecture: x64, type: 'source' }
- - { os: macos-12, python-version: "3.8", architecture: x64, type: 'source' }
- - { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'source' }
- - { os: macos-13, python-version: "3.12", architecture: x64, type: 'source' }
+ - { os: ubuntu-latest, python-version: "3.8", architecture: x64, type: 'source', continuous-only: true }
+ - { os: macos-12, python-version: "3.8", architecture: x64, type: 'source', continuous-only: true }
+ - { os: ubuntu-latest, python-version: "3.12", architecture: x64, type: 'source', continuous-only: true }
+ - { os: macos-13, python-version: "3.12", architecture: x64, type: 'source', continuous-only: true }
# Windows uses the full API up until Python 3.10.
- - { os: windows-2019, python-version: "3.8", architecture: x86, type: 'binary' }
- - { os: windows-2019, python-version: "3.9", architecture: x86, type: 'binary' }
- - { os: windows-2019, python-version: "3.10", architecture: x86, type: 'binary' }
- - { os: windows-2019, python-version: "3.11", architecture: x86, type: 'binary' }
- - { os: windows-2019, python-version: "3.12", architecture: x86, type: 'binary' }
+ - { os: windows-2019, python-version: "3.8", architecture: x86, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.9", architecture: x86, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.10", architecture: x86, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.11", architecture: x86, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.12", architecture: x86, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.8", architecture: x64, type: 'binary' }
- - { os: windows-2019, python-version: "3.9", architecture: x64, type: 'binary' }
- - { os: windows-2019, python-version: "3.10", architecture: x64, type: 'binary' }
- - { os: windows-2019, python-version: "3.11", architecture: x64, type: 'binary' }
+ - { os: windows-2019, python-version: "3.9", architecture: x64, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.10", architecture: x64, type: 'binary', continuous-only: true }
+ - { os: windows-2019, python-version: "3.11", architecture: x64, type: 'binary', continuous-only: true }
- { os: windows-2019, python-version: "3.12", architecture: x64, type: 'binary' }
+ name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Test Wheels Python ${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.type }}
+ needs: build_wheels
runs-on: ${{ matrix.os }}
if: ${{ github.event_name != 'pull_request_target' }}
defaults:
@@ -198,20 +210,24 @@
shell: bash
steps:
- name: Download Wheels
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: actions/download-artifact@v3
with:
name: python-wheels
path: wheels
- name: Download Requirements
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: actions/download-artifact@v3
with:
name: requirements
path: requirements
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Setup Python venv
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: |
python -m pip install --upgrade pip
python -m venv env
@@ -221,24 +237,28 @@
- name: Install tzdata
run: pip install tzdata
# Only needed on Windows, Linux ships with tzdata.
- if: ${{ contains(matrix.os, 'windows') }}
+ if: ${{ contains(matrix.os, 'windows') && (!matrix.continuous-only || inputs.continuous-run) }}
- name: Install requirements
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: pip install -r requirements/requirements.txt
- name: Install Protobuf Binary Wheel
+ if: ${{ matrix.type == 'binary' && (!matrix.continuous-only || inputs.continuous-run) }}
run: pip install -vvv --no-index --find-links wheels protobuf
- if: ${{ matrix.type == 'binary' }}
- name: Install Protobuf Source Wheel
+ if: ${{ matrix.type == 'source' && (!matrix.continuous-only || inputs.continuous-run) }}
run: |
cd wheels
tar -xzvf *.tar.gz
cd protobuf-*/
pip install .
- if: ${{ matrix.type == 'source' }}
- name: Test that module is importable
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: python -v -c 'from google._upb import _message; assert "google._upb._message.MessageMeta" in str(_message.MessageMeta)'
- name: Install Protobuf Test Wheel
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: pip install -vvv --no-index --find-links wheels protobuftests
- name: Run the unit tests
+ if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: |
TESTS=$(pip show -f protobuftests | grep pb_unit_tests.*py$ | sed 's,/,.,g' | sed 's,\\,.,g' | sed -E 's,.py$,,g')
for test in $TESTS; do