Merge pull request #11895 from protocolbuffers/merge-main-to-22.x
Merge main to 22.xpull/11907/head
commit
d3dad7fd4d
480 changed files with 12004 additions and 11054 deletions
@ -0,0 +1,27 @@ |
||||
# This information is extracted from the MacOS runner specs located at: |
||||
# https://github.com/actions/runner-images/blob/win19/20230129.2/images/macos/macos-12-Readme.md |
||||
xcode_version( |
||||
name = "version14_2_14C18", |
||||
version = "14.2.14C18", |
||||
aliases = ["14C18"], |
||||
default_ios_sdk_version = "16.2", |
||||
default_tvos_sdk_version = "16.1", |
||||
default_macos_sdk_version = "13.1", |
||||
default_watchos_sdk_version = "9.1", |
||||
) |
||||
|
||||
xcode_version( |
||||
name = "version14_1_0_14B47b", |
||||
version = "14.1.0.14B47b", |
||||
aliases = ["14B47b"], |
||||
default_ios_sdk_version = "16.1", |
||||
default_tvos_sdk_version = "16.1", |
||||
default_macos_sdk_version = "13.0", |
||||
default_watchos_sdk_version = "9.1", |
||||
) |
||||
|
||||
xcode_config( |
||||
name = "host_xcodes", |
||||
versions = [":version14_2_14C18", ":version14_1_0_14B47b"], |
||||
default = ":version14_1_0_14B47b", |
||||
) |
@ -0,0 +1,27 @@ |
||||
name: 'Non-Bazel Bash Run' |
||||
description: 'Run a bash script for Protobuf CI testing with a non-Bazel build system' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: "The GCP credentials to use for reading the docker image" |
||||
type: string |
||||
command: |
||||
required: true |
||||
description: A command to run in the docker image |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Setup Runner |
||||
uses: ./.github/actions/internal/setup-runner |
||||
|
||||
- name: Update stale files using Bazel |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ inputs.credentials }} |
||||
bazel-cache: regenerate-stale-files |
||||
bash: ./regenerate_stale_files.sh $BAZEL_FLAGS |
||||
|
||||
- name: Run |
||||
shell: bash |
||||
run: ${{ inputs.command }} |
@ -0,0 +1,75 @@ |
||||
name: 'Docker Bazel Run' |
||||
description: 'Run a Bazel-based docker image for Protobuf CI testing' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: "The GCP credentials to use for reading the docker image" |
||||
type: string |
||||
image: |
||||
required: false |
||||
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1 |
||||
description: "The docker image to use" |
||||
type: string |
||||
bazel-cache: |
||||
required: true |
||||
description: > |
||||
A unique path for the Bazel cache. This will trigger the generation |
||||
of a BAZEL_CACHE environment variable inside the container that provides |
||||
the appropriate flags for any bazel command. |
||||
type: string |
||||
bazel: |
||||
required: false |
||||
description: "The Bazel command to run" |
||||
type: string |
||||
bash: |
||||
required: false |
||||
description: "A bash command to run. $BAZEL_FLAGS will be available to use for bazel runs." |
||||
type: string |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Authenticate |
||||
id: auth |
||||
uses: ./.github/actions/internal/gcloud-auth |
||||
with: |
||||
credentials: ${{ inputs.credentials }} |
||||
|
||||
- name: Setup Runner |
||||
uses: ./.github/actions/internal/setup-runner |
||||
|
||||
- name: Setup Bazel |
||||
id: bazel |
||||
uses: ./.github/actions/internal/bazel-setup |
||||
with: |
||||
credentials-file: /workspace/$(basename ${{ steps.auth.outputs.credentials-file }}) |
||||
bazel-cache: ${{ inputs.bazel-cache }} |
||||
|
||||
- name: Hook up repository Cache |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache='/workspace/${{ env.REPOSITORY_CACHE_PATH }}'" >> $GITHUB_ENV |
||||
|
||||
- name: Validate inputs |
||||
if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }} |
||||
shell: bash |
||||
run: echo "Invalid specification of both non-Bazel and Bazel command"; exit 1 |
||||
|
||||
- name: Run Bash Docker |
||||
uses: ./.github/actions/internal/docker-run |
||||
if: ${{ inputs.bash }} |
||||
with: |
||||
image: ${{ inputs.image }} |
||||
run-flags: --entrypoint "/bin/bash" |
||||
command: -l -c "${{ inputs.bash }}" |
||||
|
||||
- name: Run Bazel Docker |
||||
uses: ./.github/actions/internal/docker-run |
||||
if: ${{ !inputs.bash }} |
||||
with: |
||||
image: ${{ inputs.image }} |
||||
command: ${{ inputs.bazel }} ${{ env.BAZEL_FLAGS }} |
||||
|
||||
- name: Save Bazel repository cache |
||||
# Only allow repository cache updates during post-submits. |
||||
if: ${{ github.event_name == 'push' }} |
||||
uses: ./.github/actions/internal/repository-cache-save |
@ -0,0 +1,111 @@ |
||||
name: 'Docker Bazel Run' |
||||
description: 'Run a Bazel-based docker image for Protobuf CI testing' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: The GCP credentials to use for reading the docker image |
||||
type: string |
||||
bazel-cache: |
||||
required: true |
||||
description: > |
||||
A unique path for the Bazel cache. This will trigger the generation |
||||
of a BAZEL_CACHE environment variable inside the container that provides |
||||
the appropriate flags for any bazel command. |
||||
type: string |
||||
version: |
||||
required: false |
||||
description: A pinned Bazel version to use |
||||
default: '5.1.1' |
||||
type: string |
||||
bazel: |
||||
required: false |
||||
description: The Bazel command to run |
||||
type: string |
||||
bash: |
||||
required: false |
||||
description: > |
||||
A bash command to run. $BAZEL_FLAGS and $BAZEL_STARTUP_FLAGS will be |
||||
available to use for bazel runs. |
||||
type: string |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Authenticate |
||||
id: auth |
||||
uses: ./.github/actions/internal/gcloud-auth |
||||
with: |
||||
credentials: ${{ inputs.credentials }} |
||||
|
||||
- name: Setup Runner |
||||
uses: ./.github/actions/internal/setup-runner |
||||
|
||||
- name: Setup Bazel |
||||
id: bazel |
||||
uses: ./.github/actions/internal/bazel-setup |
||||
with: |
||||
credentials-file: ${{ steps.auth.outputs.credentials-file }} |
||||
bazel-cache: ${{ inputs.bazel-cache }} |
||||
|
||||
- name: Get Linux bazelisk path |
||||
if: runner.os == 'Linux' |
||||
shell: bash |
||||
run: echo "BAZELISK_PATH=~/.cache/bazelisk" >> $GITHUB_ENV |
||||
|
||||
- name: Get MacOS bazelisk path |
||||
if: runner.os == 'macOS' |
||||
shell: bash |
||||
run: echo "BAZELISK_PATH=~/Library/Caches/bazelisk" >> $GITHUB_ENV |
||||
|
||||
- name: Get Windows bazelisk path |
||||
if: runner.os == 'Windows' |
||||
shell: bash |
||||
run: echo "BAZELISK_PATH=$LOCALAPPDATA\bazelisk" >> $GITHUB_ENV |
||||
|
||||
- name: Cache Bazelisk |
||||
if: ${{ github.event_name == 'push' }} |
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ${{ env.BAZELISK_PATH }} |
||||
key: bazel-${{ runner.os }}-${{ inputs.version }} |
||||
|
||||
- name: Restore Bazelisk |
||||
if: ${{ github.event_name != 'push' }} |
||||
uses: actions/cache/restore@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ${{ env.BAZELISK_PATH }} |
||||
key: bazel-${{ runner.os }}-${{ inputs.version }} |
||||
|
||||
- name: Hook up repository Cache |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache=$(pwd)/${{ env.REPOSITORY_CACHE_PATH }}" >> $GITHUB_ENV |
||||
|
||||
- name: Validate inputs |
||||
if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }} |
||||
shell: bash |
||||
run: echo "Invalid specification of both non-Bazel and Bazel command"; exit 1 |
||||
|
||||
- name: Pin Bazel version |
||||
shell: bash |
||||
run: echo "USE_BAZEL_VERSION=${{ inputs.version }}" >> $GITHUB_ENV |
||||
|
||||
- name: Output Bazel version |
||||
shell: bash |
||||
run: bazelisk version |
||||
|
||||
- name: Run Bash |
||||
if: ${{ inputs.bash }} |
||||
run: ${{ inputs.bash }} |
||||
shell: bash |
||||
|
||||
- name: Run Bazel |
||||
if: ${{ !inputs.bash }} |
||||
run: >- |
||||
bazelisk ${{ steps.bazel.outputs.bazel-startup-flags }} |
||||
${{ inputs.bazel }} $BAZEL_FLAGS |
||||
shell: bash |
||||
|
||||
- name: Save Bazel repository cache |
||||
# Only allow repository cache updates during post-submits. |
||||
if: ${{ github.event_name == 'push' }} |
||||
uses: ./.github/actions/internal/repository-cache-save |
@ -0,0 +1,65 @@ |
||||
name: 'CCache Setup' |
||||
description: 'Run a Bazel-based docker image for Protobuf CI testing' |
||||
inputs: |
||||
cache-prefix: |
||||
required: true |
||||
description: A unique prefix to prevent cache pollution |
||||
type: string |
||||
support-modules: |
||||
required: false |
||||
description: Whether or not we need to support modules. This can result in extra cache misses. |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Setup ccache on Windows |
||||
if: ${{ runner.os == 'Windows' }} |
||||
uses: ./.github/actions/internal/ccache-setup-windows |
||||
- name: Setup ccache on Mac |
||||
if: ${{ runner.os == 'macOS' }} |
||||
shell: bash |
||||
run: brew install ccache |
||||
|
||||
- name: Setup fixed path ccache caching |
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: .ccache |
||||
# Always push to a cache key unique to this commit. |
||||
key: ${{ format('ccache-{0}-{1}-{2}', inputs.cache-prefix, github.ref_name, github.sha) }} |
||||
# Select a cache to restore from with the follow order of preference: |
||||
# 1) The exact same commit we're running over |
||||
# 2) The latest cache from the current ref branch |
||||
# 3) The latest push to the base ref of a pull request |
||||
restore-keys: | |
||||
${{ format('ccache-{0}-{1}-{2}', inputs.cache-prefix, github.ref_name, github.sha) }} |
||||
${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.ref_name) }} |
||||
${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.base_ref) }} |
||||
|
||||
- name: Configure ccache environment variables |
||||
shell: bash |
||||
run: | |
||||
echo "CCACHE_BASEDIR=${{ github.workspace }}" >> $GITHUB_ENV |
||||
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV |
||||
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV |
||||
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV |
||||
echo "CCACHE_MAXSIZE=600M" >> $GITHUB_ENV |
||||
echo "CCACHE_SLOPPINESS=clang_index_store,include_file_ctime,include_file_mtime,file_macro,time_macros" >> $GITHUB_ENV |
||||
echo "CCACHE_DIRECT=true" >> $GITHUB_ENV |
||||
echo "CCACHE_CMAKE_FLAGS=-Dprotobuf_ALLOW_CCACHE=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache $CCACHE_CMAKE_FLAGS" >> $GITHUB_ENV |
||||
|
||||
- name: Enable module support |
||||
if: ${{ inputs.support-modules }} |
||||
shell: bash |
||||
run: | |
||||
echo "CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS,modules" >> $GITHUB_ENV |
||||
echo "CCACHE_DEPEND=true" >> $GITHUB_ENV |
||||
|
||||
- name: Zero out ccache |
||||
if: ${{ runner.os == 'macOS' }} |
||||
shell: bash |
||||
run: ccache -z |
||||
|
||||
- name: Zero out ccache |
||||
if: ${{ runner.os == 'Windows' }} |
||||
shell: pwsh |
||||
run: ${{ github.workspace }}\ccache.exe -z |
@ -0,0 +1,38 @@ |
||||
name: 'Cross-compile protoc' |
||||
description: 'Produces a cross-compiled protoc binary for a target architecture' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: The GCP credentials to use for reading the docker image |
||||
type: string |
||||
architecture: |
||||
required: true |
||||
description: The target architecture to build for |
||||
type: string |
||||
outputs: |
||||
protoc: |
||||
description: "Cross-compiled protoc location. Also output to $PROTOC" |
||||
value: ${{ steps.output.outputs.protoc }} |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Cross compile protoc for ${{ inputs.architecture }} |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
credentials: ${{ inputs.credentials }} |
||||
bazel-cache: xcompile-protoc/${{ inputs.architecture }} |
||||
bash: | |
||||
bazel build //:protoc --config=${{ inputs.architecture }} $BAZEL_FLAGS |
||||
cp bazel-bin/protoc . |
||||
|
||||
- name: Set protoc environment variable |
||||
shell: bash |
||||
run: echo "PROTOC=protoc-${{ inputs.architecture }}" >> $GITHUB_ENV |
||||
|
||||
- name: Extract binary |
||||
id: output |
||||
shell: bash |
||||
run: | |
||||
mv protoc $PROTOC |
||||
echo "protoc=$PROTOC" >> $GITHUB_OUTPUT |
@ -0,0 +1,50 @@ |
||||
name: 'Docker Non-Bazel Run' |
||||
description: 'Run a docker image for Protobuf CI testing with a non-Bazel build system' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: "The GCP credentials to use for reading the docker image" |
||||
type: string |
||||
command: |
||||
required: true |
||||
description: A command to run in the docker image |
||||
image: |
||||
required: false |
||||
default: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1 |
||||
description: "The docker image to use" |
||||
type: string |
||||
platform: |
||||
required: false |
||||
description: "The platform to use for the image" |
||||
type: string |
||||
skip-staleness-check: |
||||
required: false |
||||
description: "Skip staleness checks" |
||||
type: boolean |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Setup Runner |
||||
uses: ./.github/actions/internal/setup-runner |
||||
|
||||
- name: Update stale files using Bazel |
||||
if: ${{ !inputs.skip-staleness-check }} |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1 |
||||
credentials: ${{ inputs.credentials }} |
||||
bazel-cache: regenerate-stale-files |
||||
bash: ./regenerate_stale_files.sh $BAZEL_FLAGS |
||||
|
||||
- name: Generate docker flags |
||||
if: inputs.platform |
||||
shell: bash |
||||
run: echo "DOCKER_RUN_FLAGS=--platform ${{inputs.platform}}" >> $GITHUB_ENV |
||||
|
||||
- name: Run Docker |
||||
uses: ./.github/actions/internal/docker-run |
||||
with: |
||||
image: ${{ inputs.image }} |
||||
command: ${{ inputs.command }} |
||||
run-flags: ${{ env.DOCKER_RUN_FLAGS }} |
@ -0,0 +1,73 @@ |
||||
name: Setup Bazel |
||||
description: Setup a Bazel environment for Protobuf CI testing |
||||
inputs: |
||||
credentials-file: |
||||
required: true |
||||
description: The GCP credentials file to use for caching |
||||
type: string |
||||
bazel-cache: |
||||
required: true |
||||
description: A unique path for the Bazel cache. |
||||
type: string |
||||
|
||||
outputs: |
||||
bazel-flags: |
||||
description: Bazel flags that should be sent to all Bazel invocations |
||||
value: ${{ steps.output.outputs.bazel-flags }} |
||||
bazel-startup-flags: |
||||
description: Bazel startup flags that should be sent to all Bazel invocations |
||||
value: ${{ steps.output.outputs.bazel-startup-flags }} |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Initialize BAZEL environment variable |
||||
shell: bash |
||||
run: echo "BAZEL=bazelisk" >> $GITHUB_ENV |
||||
|
||||
- name: Initialize Windows startup flags |
||||
if: runner.os == 'Windows' |
||||
shell: bash |
||||
run: echo "BAZEL_STARTUP_FLAGS=--output_user_root=C:/tmp --windows_enable_symlinks" >> $GITHUB_ENV |
||||
|
||||
- name: Initialize Bazel flags |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=--keep_going --test_output=errors --test_timeout=600" >> $GITHUB_ENV |
||||
|
||||
- name: Initialize Windows-specific Bazel flags |
||||
if: runner.os == 'Windows' |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --enable_runfiles" >> $GITHUB_ENV |
||||
|
||||
- name: Initialize MacOS-specific Bazel flags |
||||
if: runner.os == 'macOS' |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --xcode_version_config=//.github:host_xcodes" >> $GITHUB_ENV |
||||
|
||||
- name: Configure Bazel caching |
||||
# Skip bazel cache for local act runs due to issue with credential files |
||||
# and nested docker images |
||||
if: ${{ inputs.bazel-cache && !github.event.act_local_test }} |
||||
shell: bash |
||||
run: >- |
||||
echo "BAZEL_FLAGS=$BAZEL_FLAGS |
||||
--google_credentials=${{ inputs.credentials-file }} |
||||
--remote_cache=https://storage.googleapis.com/protobuf-bazel-cache/protobuf/gha/${{ inputs.bazel-cache }}" >> $GITHUB_ENV |
||||
|
||||
- name: Configure Bazel cache writing |
||||
# External runs should never write to our caches. |
||||
if: ${{ github.event_name != 'pull_request_target' && inputs.bazel-cache && !github.event.act_local_test }} |
||||
shell: bash |
||||
run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --remote_upload_local_results" >> $GITHUB_ENV |
||||
|
||||
- name: Output Bazel flags |
||||
id: output |
||||
shell: bash |
||||
run: | |
||||
echo "bazel-flags=$BAZEL_FLAGS" >> $GITHUB_OUTPUT |
||||
echo "bazel-startup-flags=$BAZEL_STARTUP_FLAGS" >> $GITHUB_OUTPUT |
||||
|
||||
- name: Restore Bazel repository cache |
||||
uses: ./.github/actions/internal/repository-cache-restore |
||||
with: |
||||
bazel-cache: ${{ inputs.bazel-cache }} |
@ -0,0 +1,36 @@ |
||||
name: 'CCache Setup' |
||||
description: 'Setup ccache for us in Windows CI' |
||||
inputs: |
||||
ccache-version: |
||||
required: false |
||||
default: '4.7.4' |
||||
description: A pinned version of ccache |
||||
type: string |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Configure ccache environment variables |
||||
shell: pwsh |
||||
run: | |
||||
Write-Host $Env:GITHUB_REF |
||||
$cllocation = (Get-Command cl.exe).Path |
||||
echo "CCACHE_COMPILER=$cllocation" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append |
||||
echo "CCACHE_COMPILERTYPE=msvc" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append |
||||
|
||||
- name: Download ccache |
||||
shell: bash |
||||
run: | |
||||
curl -kLSs "https://github.com/ccache/ccache/releases/download/v${{ inputs.ccache-version }}/ccache-${{ inputs.ccache-version }}-windows-x86_64.zip" -o ccache.zip |
||||
unzip ccache.zip |
||||
cp ccache-${{ inputs.ccache-version }}-windows-x86_64/ccache.exe ccache.exe |
||||
cp ccache.exe cl.exe |
||||
rm ccache.zip |
||||
|
||||
- name: Configure msbuild flags |
||||
shell: bash |
||||
run: echo "CCACHE_MSBUILD_FLAGS=/p:CLToolExe=cl.exe /p:CLToolPath=${{ github.workspace}}" >> $GITHUB_ENV |
||||
|
||||
- name: Configure cmake flags |
||||
shell: bash |
||||
run: echo "CCACHE_CMAKE_FLAGS=-Dprotobuf_ALLOW_CCACHE=ON" >> $GITHUB_ENV |
@ -0,0 +1,62 @@ |
||||
name: 'Run Docker' |
||||
description: 'Run a docker image for Protobuf CI testing' |
||||
inputs: |
||||
image: |
||||
required: true |
||||
description: "The docker image to use" |
||||
type: string |
||||
command: |
||||
required: true |
||||
description: "A raw docker command to run" |
||||
type: string |
||||
run-flags: |
||||
required: false |
||||
description: "Additional flags to pass to docker run" |
||||
type: string |
||||
|
||||
# WARNING: loading from cache appears to be slower than pull! |
||||
docker-cache: |
||||
required: false |
||||
description: "Enabled caching of pulled docker images." |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Authenticate for GAR use |
||||
shell: bash |
||||
run: gcloud auth configure-docker -q us-docker.pkg.dev |
||||
|
||||
- name: Setup QEMU for possible emulation |
||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0 |
||||
|
||||
- name: Check docker cache |
||||
if: ${{ inputs.docker-cache }} |
||||
id: check-docker-cache |
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ci/docker/ |
||||
key: ${{ inputs.image }} |
||||
|
||||
- name: Pull and store if cache miss |
||||
shell: bash |
||||
if: ${{ inputs.docker-cache && steps.check-docker-cache.outputs.cache-hit != 'true' }} |
||||
run: > |
||||
time docker pull -q ${{ inputs.image }} && |
||||
mkdir -p ci/docker/$(dirname ${{ inputs.image }}) && |
||||
time docker image save ${{ inputs.image }} --output ./ci/docker/${{ inputs.image }}.tar |
||||
|
||||
- name: Use the cached image on cache hit |
||||
shell: bash |
||||
if: ${{ inputs.docker-cache && steps.check-docker-cache.outputs.cache-hit == 'true' }} |
||||
run: time docker image load --input ./ci/docker/${{ inputs.image }}.tar |
||||
|
||||
- name: Pull fresh docker image |
||||
shell: bash |
||||
if: ${{ !inputs.docker-cache }} |
||||
run: time docker pull -q ${{ inputs.image }} |
||||
|
||||
- name: Run docker |
||||
shell: bash |
||||
run: > |
||||
time docker run ${{ inputs.run-flags}} -v${{ github.workspace }}:/workspace |
||||
${{ inputs.image }} ${{ inputs.command }} |
@ -0,0 +1,42 @@ |
||||
name: 'Authenticate for GCP' |
||||
description: 'Authenticate a workflow for Protobuf CI testing' |
||||
inputs: |
||||
credentials: |
||||
required: true |
||||
description: "The GCP credentials to use for GCP" |
||||
type: string |
||||
|
||||
outputs: |
||||
credentials-file: |
||||
description: "Credentials file generated for GCP" |
||||
value: ${{ steps.output.outputs.credentials-file }} |
||||
|
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Authenticate to Google Cloud |
||||
id: auth |
||||
uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d # v1.0.0 |
||||
with: |
||||
credentials_json: ${{ inputs.credentials }} |
||||
- name: Set up Cloud SDK |
||||
uses: google-github-actions/setup-gcloud@d51b5346f85640ec2aa2fa057354d2b82c2fcbce # v1.0.1 |
||||
- name: Use gcloud CLI |
||||
shell: bash |
||||
run: gcloud info |
||||
|
||||
- name: Store credentials path |
||||
shell: bash |
||||
run: echo "CREDENTIALS_FILE=${{ steps.auth.outputs.credentials_file_path }}" >> $GITHUB_ENV |
||||
|
||||
- name: Fix credentials path (Windows) |
||||
if: ${{ runner.os == 'Windows' }} |
||||
# Bash commands in windows don't like the backslash in the file path. |
||||
# Assume we're running in the root directory and grab the base name. |
||||
shell: bash |
||||
run: echo "CREDENTIALS_FILE="$(basename ${CREDENTIALS_FILE//\\//}) >> $GITHUB_ENV |
||||
|
||||
- name: Output credentials file |
||||
id: output |
||||
shell: bash |
||||
run: echo "credentials-file=${{ env.CREDENTIALS_FILE }}" >> $GITHUB_OUTPUT |
@ -0,0 +1,41 @@ |
||||
name: Restore Repository Cache |
||||
description: Restore the Bazel repository cache from our github action cache |
||||
inputs: |
||||
bazel-cache: |
||||
required: true |
||||
description: A unique path for the Bazel cache. |
||||
type: string |
||||
|
||||
# By design, these actions will restore the latest cache for this branch/os, |
||||
# and only save a new version if something has changed. Initially this will |
||||
# cause a lot of churn, since each test has a slightly different set of |
||||
# repositories to download. Over time though, since we don't upload no-op |
||||
# changes, this should converge to a stable set of 3 caches per branch. Every |
||||
# run will update the current cache with a new test's repositories, until there |
||||
# are no unique ones left. |
||||
# |
||||
# This saves asymptotic space, since each one of these can get up to ~500 MB |
||||
# and Github prunes the cache after 10 GB. |
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Setup Bazel repository cache variables |
||||
shell: bash |
||||
run: | |
||||
REPOSITORY_CACHE_BASE=repository-cache-${{ github.base_ref || github.ref_name }}-${{ runner.os }} |
||||
echo "REPOSITORY_CACHE_BASE=$REPOSITORY_CACHE_BASE" >> $GITHUB_ENV |
||||
echo "REPOSITORY_CACHE_NAME=$REPOSITORY_CACHE_BASE-${{ inputs.bazel-cache}}-${{ github.sha }}" >> $GITHUB_ENV |
||||
echo "REPOSITORY_CACHE_PATH=.repository-cache" >> $GITHUB_ENV |
||||
|
||||
- name: Restore Bazel repository cache |
||||
id: restore-cache |
||||
uses: actions/cache/restore@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ${{ github.workspace }}/${{ env.REPOSITORY_CACHE_PATH }} |
||||
key: ${{ env.REPOSITORY_CACHE_NAME }} |
||||
restore-keys: ${{ env.REPOSITORY_CACHE_BASE }} |
||||
|
||||
- name: Initialize BAZEL environment variable |
||||
if: ${{ steps.restore-cache.cache-hit }} |
||||
shell: bash |
||||
run: echo "REPOSITORY_CACHE_HASH=${{ hashFiles(format('{0}/**', env.REPOSITORY_CACHE_PATH)) }}" >> $GITHUB_ENV |
@ -0,0 +1,19 @@ |
||||
name: Restore Repository Cache |
||||
description: Restore the Bazel repository cache from our github action cache |
||||
|
||||
# Note: this action will only work if repository-cache-restore has already |
||||
# been called. All bazel actions should specify the repository_cache parameter |
||||
# using REPOSITORY_CACHE_PATH. |
||||
# |
||||
# We intentionally upload to REPOSITORY_CACHE_BASE to prevent a flood of new |
||||
# caches on any change. Only 1 job per os in each test run will be allowed to |
||||
# update the cache because they're all trying to write to the same location. |
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Save modified Bazel repository cache |
||||
if: ${{ env.REPOSITORY_CACHE_HASH != hashFiles(format('{0}/**', env.REPOSITORY_CACHE_PATH)) }} |
||||
uses: actions/cache/save@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ${{ github.workspace }}/${{ env.REPOSITORY_CACHE_PATH }} |
||||
key: ${{ env.REPOSITORY_CACHE_BASE }}-${{ github.sha }} |
@ -0,0 +1,17 @@ |
||||
name: Setup CI Runner |
||||
# TODO(b/267357823) Consider moving this to it's own repository so we can |
||||
# include the call to actions/checkout. |
||||
description: Setup any platform-specific adjustments we need to make for CI |
||||
runs: |
||||
using: 'composite' |
||||
steps: |
||||
- name: Fix Windows line breaks |
||||
if: runner.os == 'Windows' |
||||
shell: bash |
||||
run: find . -type f -print0 | xargs -0 d2u 2>/dev/null |
||||
|
||||
- name: Install bazelrc files |
||||
shell: bash |
||||
run: | |
||||
cp ci/*.bazelrc . |
||||
cp -f ${{ runner.os }}.bazelrc .bazelrc |
@ -1,15 +0,0 @@ |
||||
mergeable: |
||||
pull_requests: |
||||
label: |
||||
and: |
||||
- must_exclude: |
||||
regex: '^disposition/DO NOT MERGE' |
||||
message: 'Pull request marked not mergeable' |
||||
- must_include: |
||||
regex: 'mergeable:force-allow' |
||||
message: 'Pull requests should not be merged directly and should instead |
||||
be handled by Copybara. |
||||
|
||||
To enable Github merges, add the `mergeable:force-allow` label and get a second |
||||
approval. This should almost never be used except for releases or as a break glass |
||||
measure after discussing with the team.' |
@ -0,0 +1,29 @@ |
||||
name: Clear expensive caches to prevent unbounded growth |
||||
|
||||
on: |
||||
schedule: |
||||
# Run every 1st of the month at 10 AM UTC (2 AM PDT) |
||||
- cron: 0 10 1 * * |
||||
|
||||
# manual |
||||
workflow_dispatch: |
||||
|
||||
jobs: |
||||
bazel-repository-cache: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
os: [ubuntu-latest, macos-latest, windows-latest] |
||||
name: Clear Bazel repository cache ${{ runner.os }} |
||||
runs-on: ${{ matrix.os }} |
||||
steps: |
||||
- uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4 |
||||
with: |
||||
path: ${{ github.workspace }}/${{ steps.output.outputs.repository-cache }} |
||||
key: repository-cache-${{ github.ref_name }}-${{ runner.os }}-reset-${{ github.sha }} |
||||
|
||||
- name: Create an empty cache with a single file |
||||
run: | |
||||
rm -rf .repository-cache |
||||
mkdir -p .repository-cache' |
||||
touch .repository-cache/reset_file |
@ -1,40 +0,0 @@ |
||||
name: 'ObjC CocoaPods' |
||||
|
||||
on: |
||||
push: |
||||
paths: |
||||
- '.github/workflows/objc_cocoapods.yml' |
||||
- 'Protobuf.podspec' |
||||
- 'objectivec/**' |
||||
- '!objectivec/DevTools/**' |
||||
- '!objectivec/ProtocolBuffers_*.xcodeproj/**' |
||||
- '!objectivec/Tests/**' |
||||
pull_request: |
||||
paths: |
||||
- '.github/workflows/objc_cocoapods.yml' |
||||
- 'Protobuf.podspec' |
||||
- 'objectivec/**' |
||||
- '!objectivec/DevTools/**' |
||||
- '!objectivec/ProtocolBuffers_*.xcodeproj/**' |
||||
- '!objectivec/Tests/**' |
||||
|
||||
permissions: |
||||
contents: read # to fetch code (actions/checkout) |
||||
|
||||
jobs: |
||||
pod-lib-lint: |
||||
runs-on: macos-latest |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
# Add back 'watchos'. See CocoaPods/CocoaPods#11558 |
||||
PLATFORM: ["ios", "macos", "tvos"] |
||||
CONFIGURATION: ["Debug", "Release"] |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- name: Pod lib lint |
||||
run: | |
||||
pod lib lint --verbose \ |
||||
--configuration=${{ matrix.CONFIGURATION }} \ |
||||
--platforms=${{ matrix.PLATFORM }} \ |
||||
Protobuf.podspec |
@ -1,67 +0,0 @@ |
||||
name: Ruby Install Tests |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- main |
||||
- '[0-9]+.x' |
||||
pull_request: |
||||
branches: |
||||
- main |
||||
- '[0-9]+.x' |
||||
workflow_dispatch: |
||||
|
||||
jobs: |
||||
test_ruby_gems: |
||||
name: Test ruby gems |
||||
runs-on: ubuntu-20.04 |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
include: |
||||
- { ruby: 2.6, bazel: 6.0.0} |
||||
- { ruby: 2.7, bazel: 6.0.0} |
||||
- { ruby: 3.0, bazel: 6.0.0} |
||||
- { ruby: 3.1, bazel: 6.0.0} |
||||
- { ruby: 3.2, bazel: 6.0.0} |
||||
- { ruby: jruby-9.2, bazel: 6.0.0} |
||||
- { ruby: jruby-9.3, bazel: 6.0.0} |
||||
- { ruby: 2.6, bazel: 5.1.1} |
||||
- { ruby: jruby-9.2, bazel: 5.1.1} |
||||
|
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- name: Install bazel |
||||
run: | |
||||
sudo apt-get install -qy wget |
||||
mkdir $HOME/bin |
||||
wget -O $HOME/bin/bazel https://github.com/bazelbuild/bazel/releases/download/${{ matrix.bazel }}/bazel-${{ matrix.bazel }}-linux-x86_64 |
||||
chmod a+x $HOME/bin/bazel |
||||
- name: Install git |
||||
run: | |
||||
sudo apt-get install -qy --no-install-recommends git |
||||
- name: Install ruby |
||||
uses: ruby/setup-ruby@v1 |
||||
with: |
||||
ruby-version: ${{ matrix.ruby }} |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
with: |
||||
submodules: recursive |
||||
- name: Build cruby gem |
||||
run: $HOME/bin/bazel build ruby:release |
||||
if: ${{ !contains(matrix.ruby, 'jruby') }} |
||||
- name: Install cruby gem |
||||
run: gem install bazel-bin/ruby/google-protobuf-* |
||||
if: ${{ !contains(matrix.ruby, 'jruby') }} |
||||
- name: Build jruby gem |
||||
run: $HOME/bin/bazel build ruby:jruby_release |
||||
if: ${{ contains(matrix.ruby, 'jruby') }} |
||||
- name: Install jruby gem |
||||
run: gem install bazel-bin/ruby/google-protobuf-* |
||||
if: ${{ contains(matrix.ruby, 'jruby') }} |
||||
- name: Test installation |
||||
run: | |
||||
bazel run //:protoc -- --proto_path=$GITHUB_WORKSPACE/src --proto_path=$GITHUB_WORKSPACE/ruby/tests --proto_path=$GITHUB_WORKSPACE/ruby --ruby_out=$GITHUB_WORKSPACE/ruby tests/test_import_proto2.proto |
||||
bazel run //:protoc -- --proto_path=$GITHUB_WORKSPACE/src --proto_path=$GITHUB_WORKSPACE/ruby/tests --proto_path=$GITHUB_WORKSPACE/ruby --ruby_out=$GITHUB_WORKSPACE/ruby tests/basic_test.proto |
||||
ruby ruby/tests/basic.rb |
@ -0,0 +1,30 @@ |
||||
name: Staleness tests |
||||
|
||||
on: |
||||
schedule: |
||||
# Run daily at 10 AM UTC (2 AM PDT) |
||||
- cron: 0 10 * * * |
||||
|
||||
permissions: {} |
||||
jobs: |
||||
test: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
branch: [main, 22.x] |
||||
os: [{ name: Linux, value: ubuntu-latest}] |
||||
|
||||
name: ${{ matrix.os.name }} ${{ matrix.branch}} |
||||
runs-on: ${{ matrix.os.value }} |
||||
steps: |
||||
- name: Checkout ${{ matrix.branch }} |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ matrix.branch}} |
||||
|
||||
- name: Run all staleness tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: staleness_check/${{ matrix.branch}}_${{ matrix.os.value }} |
||||
bash: bazel query 'attr(tags, "staleness_test", //...)' | xargs bazel test $BAZEL_FLAGS |
@ -0,0 +1,330 @@ |
||||
name: C++ Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
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 } |
||||
- { name: ASAN, flags: --config=asan } |
||||
- { name: MSAN, flags: --config=kokoro-msan } |
||||
- { name: TSAN, flags: --config=tsan } |
||||
- { name: UBSAN, flags: --config=ubsan } |
||||
- { name: No-RTTI, flags: --cxxopt=-fno-rtti } |
||||
include: |
||||
# Set defaults |
||||
- image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:dbd2f15fb69734d72c3fd10cb819bbe2ce4890acf49e9a2f9403983fe48e8807 |
||||
- targets: //pkg/... //src/... @com_google_protobuf_examples//... |
||||
|
||||
# Override cases with custom images |
||||
- config: { name: "TCMalloc" } |
||||
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc@sha256:9d975616c3fd44d5a091aeb60ee94f37e22fb367d471d258fc18cb4a2387c943" |
||||
targets: "//src/..." |
||||
- config: { name: "aarch64" } |
||||
targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test" |
||||
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-e863f8ec6b1dfe41f7dc573bac9c8072a0a68b1b" |
||||
- config: { name: "Bazel4" } |
||||
targets: "//src/..." |
||||
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:4.2.3-3b71de326b62f67bf754c4dc4016d6a2fa9dd664" |
||||
name: Linux ${{ matrix.config.name }} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: ${{ matrix.image }} |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: cpp_linux/${{ matrix.config.name }} |
||||
bazel: test ${{ matrix.targets }} ${{ matrix.config.flags }} --distinct_host_configuration=false |
||||
|
||||
linux-cmake: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
- command: >- |
||||
/test.sh |
||||
-Dprotobuf_BUILD_CONFORMANCE=ON |
||||
-Dprotobuf_BUILD_EXAMPLES=ON |
||||
-DCMAKE_CXX_STANDARD=14 |
||||
- name: Ninja |
||||
command: >- |
||||
/test.sh |
||||
-G Ninja |
||||
-Dprotobuf_BUILD_CONFORMANCE=ON |
||||
-DCMAKE_CXX_STANDARD=14 |
||||
- name: Shared |
||||
command: >- |
||||
/test.sh |
||||
-Dprotobuf_BUILD_CONFORMANCE=ON |
||||
-Dprotobuf_BUILD_SHARED_LIBS=ON |
||||
-DCMAKE_CXX_STANDARD=14 |
||||
|
||||
name: Linux CMake ${{ matrix.name}} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: linux-cmake-${{ matrix.name }} |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:e8282f42b1c1c0e6227d746e861954fd6fad0bd2e7424e6ceb23c249289a4016 |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: ${{ matrix.command }} ${{ env.CCACHE_CMAKE_FLAGS }} |
||||
|
||||
linux-cmake-install: |
||||
name: Linux CMake Install |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: linux-cmake-install |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:e8282f42b1c1c0e6227d746e861954fd6fad0bd2e7424e6ceb23c249289a4016 |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} \&\& |
||||
/test.sh |
||||
${{ env.CCACHE_CMAKE_FLAGS }} |
||||
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON |
||||
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF |
||||
-Dprotobuf_BUILD_CONFORMANCE=ON |
||||
-DCMAKE_CXX_STANDARD=14 |
||||
|
||||
linux-cmake-32-bit: |
||||
name: Linux CMake 32-bit |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: linux-cmake-32-bit |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:f99f051daa8b12f4ebad5927f389bc71372f771ab080290ab451cbaf1648f9ea |
||||
platform: linux/386 |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/bin/bash -c ' |
||||
cd /workspace; |
||||
ccache -z; |
||||
cmake . -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }}; |
||||
cmake --build . --parallel 20; |
||||
ctest --verbose --parallel 20; |
||||
ccache -s' |
||||
|
||||
non-linux: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
- name: MacOS |
||||
os: macos-12 |
||||
bazel: //src/... |
||||
- name: Windows |
||||
os: windows-2019 |
||||
bazel: //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance |
||||
name: ${{ matrix.name }} Bazel |
||||
runs-on: ${{ matrix.os }} |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel: test ${{ matrix.bazel }} |
||||
bazel-cache: cpp_${{ matrix.os }} |
||||
|
||||
macos-cmake: |
||||
name: MacOS CMake |
||||
runs-on: macos-12 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: macos-cmake |
||||
|
||||
- name: Configure CMake |
||||
uses: ./.github/actions/bash |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: cmake . -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} |
||||
- name: Build |
||||
run: cmake --build . --parallel 8 |
||||
- name: Test |
||||
run: ctest --verbose --parallel 20 -C Debug |
||||
|
||||
- name: Report ccache stats |
||||
shell: bash |
||||
run: ccache -s -v |
||||
|
||||
windows-cmake: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
- name: Visual Studio |
||||
flags: >- |
||||
-Dprotobuf_BUILD_SHARED_LIBS=OFF |
||||
-Dprotobuf_BUILD_EXAMPLES=ON |
||||
- name: Shared |
||||
flags: -Dprotobuf_BUILD_SHARED_LIBS=ON |
||||
|
||||
name: Windows CMake ${{ matrix.name}} |
||||
runs-on: windows-2019 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup MSVC |
||||
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1 |
||||
with: |
||||
arch: x64 |
||||
vsversion: '2019' |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: windows-cmake-${{ matrix.name }} |
||||
|
||||
- name: Configure CMake |
||||
uses: ./.github/actions/bash |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: | |
||||
cmake . -G "Visual Studio 16 2019" -A x64 \ |
||||
${{ env.CCACHE_CMAKE_FLAGS }} \ |
||||
-Dprotobuf_BUILD_CONFORMANCE=OFF \ |
||||
-Dprotobuf_WITH_ZLIB=OFF \ |
||||
${{ matrix.flags }} |
||||
|
||||
- name: Build for Windows 15 2017 |
||||
run: >- |
||||
msbuild.exe protobuf.sln /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true |
||||
/p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 |
||||
${{ env.CCACHE_MSBUILD_FLAGS }} |
||||
|
||||
- name: Run Tests |
||||
run: ctest --verbose --parallel 20 -C Debug |
||||
|
||||
- name: Report ccache stats |
||||
run: ${{ github.workspace }}\ccache.exe -s -v |
||||
|
||||
windows-cmake-install: |
||||
name: Windows CMake Install |
||||
runs-on: windows-2019 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup MSVC |
||||
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1 |
||||
with: |
||||
arch: x64 |
||||
vsversion: '2019' |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: windows-cmake |
||||
|
||||
- name: Configure CMake for Install |
||||
uses: ./.github/actions/bash |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: | |
||||
mkdir build |
||||
pushd build |
||||
cmake .. -G "Visual Studio 16 2019" -A x64 \ |
||||
${{ env.CCACHE_CMAKE_FLAGS }} \ |
||||
-Dprotobuf_BUILD_CONFORMANCE=OFF \ |
||||
-Dprotobuf_WITH_ZLIB=OFF |
||||
popd |
||||
|
||||
- name: Build and Install Protobuf for Windows 15 2017 |
||||
run: | |
||||
pushd build |
||||
msbuild.exe INSTALL.vcxproj /p:Platform=x64 /p:VisualStudioVersion=15.0 /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true ${{ env.CCACHE_MSBUILD_FLAGS }} |
||||
popd |
||||
|
||||
- name: Clear CMake cache |
||||
shell: bash |
||||
run: rm -rf build/* |
||||
|
||||
- name: Configure CMake |
||||
shell: bash |
||||
run: | |
||||
cmake . -G "Visual Studio 16 2019" -A x64 \ |
||||
${{ env.CCACHE_CMAKE_FLAGS }} \ |
||||
-Dprotobuf_REMOVE_INSTALLED_HEADERS=ON \ |
||||
-Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF \ |
||||
-Dprotobuf_BUILD_CONFORMANCE=OFF \ |
||||
-Dprotobuf_WITH_ZLIB=OFF |
||||
|
||||
- name: Build for Windows 15 2017 |
||||
run: >- |
||||
msbuild.exe protobuf.sln /p:MultiProcessorCompilation=true /p:CL_MPCount=8 /maxcpucount:8 /p:BuildInParallel=true |
||||
/p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=15.0 |
||||
${{ env.CCACHE_MSBUILD_FLAGS }} |
||||
|
||||
- name: Run Tests |
||||
run: ctest --verbose --parallel 20 -C Debug |
||||
|
||||
- name: Report ccache stats |
||||
run: ${{ github.workspace }}\ccache.exe -s -v |
@ -0,0 +1,86 @@ |
||||
name: C# Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
linux: |
||||
name: Linux |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/csharp:3.1.415-6.0.100-65526ea124d1034eac33e7c37cc6d65c5bef054f |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: csharp_linux |
||||
bazel: test //csharp/... --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=/home/bazel |
||||
|
||||
windows: |
||||
name: Windows |
||||
runs-on: windows-2019 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup dotnet |
||||
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 |
||||
with: |
||||
dotnet-version: '6.0.x' |
||||
|
||||
- name: Build |
||||
run: dotnet build csharp/src/Google.Protobuf.sln |
||||
|
||||
- name: Run Tests |
||||
run: dotnet test csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj |
||||
|
||||
linux-aarch64: |
||||
name: Linux aarch64 |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Build protobuf C# tests under x86_64 docker image |
||||
# Tests are built "dotnet publish" because we want all the dependencies to the copied to the destination directory |
||||
# (we want to avoid references to ~/.nuget that won't be available in the subsequent docker run) |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/bin/bash -c ' |
||||
DOTNET_CLI_TELEMETRY_OPTOUT=true |
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true |
||||
dotnet publish -c Release -f net60 /workspace/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj' |
||||
|
||||
- name: Use an actual aarch64 docker image to run protobuf C# tests with an emulator |
||||
# "dotnet vstest" allows running tests from a pre-built project. |
||||
# * mount the protobuf root as /work to be able to access the crosscompiled files |
||||
# * to avoid running the process inside docker as root (which can pollute the workspace with files owned by root), we force |
||||
# running under current user's UID and GID. To be able to do that, we need to provide a home directory for the user |
||||
# otherwise the UID would be homeless under the docker container and pip install wouldn't work. For simplicity, |
||||
# we just run map the user's home to a throwaway temporary directory |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim-arm64v8 |
||||
skip-staleness-check: true |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/bin/bash -c ' |
||||
DOTNET_CLI_TELEMETRY_OPTOUT=true |
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true |
||||
dotnet vstest /workspace/csharp/src/Google.Protobuf.Test/bin/Release/net60/publish/Google.Protobuf.Test.dll' |
@ -0,0 +1,69 @@ |
||||
name: Java Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
linux: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
include: |
||||
- name: OpenJDK 11 |
||||
version: '11' |
||||
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-aec4d74f2eb6938fc53ef7d9a79a4bf2da24abc1 |
||||
targets: //java/... //java/internal:java_version |
||||
- name: OpenJDK 17 |
||||
version: '17' |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:17-65526ea124d1034eac33e7c37cc6d65c5bef054f |
||||
targets: //java/... //java/internal:java_version |
||||
- name: aarch64 |
||||
version: 'aarch64' |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-e863f8ec6b1dfe41f7dc573bac9c8072a0a68b1b |
||||
targets: //java/... //src/google/protobuf/compiler:protoc_aarch64_test |
||||
|
||||
name: Linux ${{ matrix.name }} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: ${{ matrix.image }} |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: java_linux/${{ matrix.version }} |
||||
bazel: test ${{ matrix.targets }} --test_env=KOKORO_JAVA_VERSION |
||||
|
||||
linkage-monitor: |
||||
name: Linux Linkage Monitor |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Build protoc |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: java_linux_linkage |
||||
bash: | |
||||
$BAZEL build //:protoc $BAZEL_FLAGS |
||||
# The java build setup expects protoc in the root directory. |
||||
cp bazel-bin/protoc . |
||||
- name: Install snapshot version locally |
||||
run: | |
||||
cd java |
||||
mvn -e -B -Dhttps.protocols=TLSv1.2 install -Dmaven.test.skip=true |
||||
- name: Download Linkage Monitor |
||||
run: curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/linkage-monitor-latest-all-deps.jar" |
||||
- name: Fails if there's new linkage errors compared with baseline |
||||
run: java -Xmx2048m -jar linkage-monitor-latest-all-deps.jar com.google.cloud:libraries-bom |
@ -0,0 +1,102 @@ |
||||
name: Objective-C Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
xcode: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
- name: macOS |
||||
config: osx |
||||
flags: --skip-xcode-ios --skip-xcode-tvos --skip-objc-conformance |
||||
# The iOS simulator takes a while to start up, so Debug & Release are run in |
||||
# parallel to get the testing done faster. |
||||
- name: iOS Debug |
||||
config: ios_debug |
||||
flags: --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-release |
||||
- name: iOS Release |
||||
config: ios_release |
||||
flags: --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-debug |
||||
|
||||
name: Xcode ${{ matrix.name}} |
||||
runs-on: macos-12 |
||||
env: |
||||
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Setup ccache |
||||
uses: ./.github/actions/ccache |
||||
with: |
||||
cache-prefix: objectivec_macos_${{ matrix.config }} |
||||
support-modules: true |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
env: |
||||
CC: ${{ github.workspace }}/ci/clang_wrapper |
||||
CXX: ${{ github.workspace }}/ci/clang_wrapper++ |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: objectivec_macos/${{ matrix.config }} |
||||
bash: objectivec/DevTools/full_mac_build.sh ${{ matrix.flags }} |
||||
|
||||
- name: Report ccache stats |
||||
shell: bash |
||||
run: ccache -s -v |
||||
|
||||
pod-lib-lint: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
# Add back 'watchos'. See CocoaPods/CocoaPods#11558 |
||||
PLATFORM: ["ios", "macos", "tvos"] |
||||
CONFIGURATION: ["Debug", "Release"] |
||||
name: CocoaPods ${{ matrix.PLATFORM}} ${{ matrix.CONFIGURATION}} |
||||
runs-on: macos-12 |
||||
env: |
||||
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Pod lib lint |
||||
run: | |
||||
pod lib lint --verbose \ |
||||
--configuration=${{ matrix.CONFIGURATION }} \ |
||||
--platforms=${{ matrix.PLATFORM }} \ |
||||
Protobuf.podspec |
||||
|
||||
bazel: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
# TODO: Could add iOS to atleast build the objc_library targets for that. |
||||
- name: macOS |
||||
bazel: //objectivec/... |
||||
name: Bazel ${{ matrix.name }} |
||||
runs-on: macos-12 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel: test ${{ matrix.bazel }} |
||||
bazel-cache: objc_${{ matrix.name }} |
@ -0,0 +1,182 @@ |
||||
name: PHP Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
linux: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
include: |
||||
- name: 7.3 Debug |
||||
version: 7.3.28-dbg |
||||
command: composer test \&\& composer test_c |
||||
- name: 7.4 Debug |
||||
version: 7.4.18-dbg |
||||
command: composer test \&\& composer test_c |
||||
- name: 8.0 Optimized |
||||
version: 8.0.5 |
||||
command: composer test \&\& composer test_c |
||||
- name: 8.0 Debug |
||||
version: 8.0.5-dbg |
||||
command: composer test \&\& composer test_c |
||||
- name: 8.0 Memory Leak |
||||
version: 8.0.5-dbg |
||||
# Run specialized memory leak & multirequest tests. |
||||
command: composer test_c \&\& tests/multirequest.sh \&\& tests/memory_leak_test.sh |
||||
- name: 8.0 Valgrind |
||||
version: 8.0.5-dbg |
||||
command: composer test_valgrind |
||||
|
||||
name: Linux ${{ matrix.name}} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.version }}-6e95c0e221e4bd52e3b4dc1398c6336985196931 |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: ${{ matrix.command }} |
||||
|
||||
linux-32bit: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
version: ['7.4', '8.0'] |
||||
suffix: [ '', '-zts'] |
||||
test: ['test', 'test_c'] |
||||
exclude: |
||||
- suffix: '-zts' |
||||
test: 'test' |
||||
include: |
||||
- suffix: '-zts' |
||||
suffix_name: ' Thread Safe' |
||||
- test: 'test_c' |
||||
test_name: ' Extension' |
||||
|
||||
name: 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:97f50ab24582380012d7ddef5f82f08e19b9dff55d09a4a8d90a87421ae66a45 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Cross compile protoc for i386 |
||||
id: cross-compile |
||||
uses: ./.github/actions/cross-compile-protoc |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
architecture: linux-i386 |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: ${{ env.image }} |
||||
skip-staleness-check: true |
||||
platform: linux/386 |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/bin/bash -c ' |
||||
cd php && php -v && php -m; |
||||
composer update --ignore-platform-reqs; |
||||
PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} |
||||
PATH="/usr/local/php-${{ matrix.version }}${{matrix.suffix}}/bin:$PATH" |
||||
composer ${{ matrix.test }}' |
||||
|
||||
linux-aarch64: |
||||
name: Linux aarch64 |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Cross compile protoc for aarch64 |
||||
id: cross-compile |
||||
uses: ./.github/actions/cross-compile-protoc |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
architecture: linux-aarch64 |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-aarch64:0cc100b6e03d14c1e8f71ae794dc162ed122fe31@sha256:77b70feba68dced1f0fd21b52a08d3d2e0c5c797bfe68435a0038ce87ecfd310 |
||||
platform: linux/arm64 |
||||
skip-staleness-check: true |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
-c ' |
||||
cd php; |
||||
composer update --ignore-platform-reqs; |
||||
PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} |
||||
composer test; |
||||
PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} |
||||
composer test_c' |
||||
|
||||
macos: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
version: ['7.4', '8.0'] |
||||
|
||||
name: MacOS PHP ${{ matrix.version }} |
||||
runs-on: macos-12 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Install dependencies |
||||
run: brew install coreutils # For sha256sum |
||||
|
||||
- name: Pin PHP version |
||||
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # 2.24.0 |
||||
with: |
||||
php-version: ${{ matrix.version }} |
||||
|
||||
- name: Check PHP version |
||||
run: php --version | grep ${{ matrix.version }} || (echo "Invalid PHP version - $(php --version)" && exit 1) |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: php_macos/${{ matrix.version }} |
||||
bash: | |
||||
pushd php |
||||
rm -rf vendor |
||||
php -v |
||||
php -m |
||||
composer update |
||||
composer test_c |
||||
popd |
||||
|
||||
- name: Run conformance tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: php_macos/${{ matrix.version }} |
||||
bash: >- |
||||
bazelisk $BAZEL_STARTUP_FLAGS \ |
||||
test $BAZEL_FLAGS \ |
||||
--action_env=PATH --test_env=PATH \ |
||||
//php:conformance_test_c |
@ -0,0 +1,95 @@ |
||||
name: Python Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
linux: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
type: [ Pure, C++] |
||||
version: [ "3.7", "3.8", "3.9", "3.10" ] |
||||
include: |
||||
- type: Pure |
||||
targets: //python/... @upb//python/... //python:python_version |
||||
flags: --define=use_fast_cpp_protos=false |
||||
- type: C++ |
||||
targets: //python/... //python:python_version |
||||
flags: --define=use_fast_cpp_protos=true |
||||
- type: C++ |
||||
version: aarch64 |
||||
targets: //python/... //python:aarch64_test |
||||
# TODO(b/262628111) 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-e863f8ec6b1dfe41f7dc573bac9c8072a0a68b1b |
||||
|
||||
name: Linux ${{ matrix.type }} ${{ matrix.version }} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-65526ea124d1034eac33e7c37cc6d65c5bef054f', matrix.version) }} |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }} |
||||
bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION |
||||
|
||||
|
||||
macos: |
||||
strategy: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
type: [ Pure, C++] |
||||
# TODO(b/267550843) Consider expanding this set of versions. |
||||
version: [ "3.10" ] |
||||
include: |
||||
- type: Pure |
||||
targets: //python/... @upb//python/... //python:python_version |
||||
- type: C++ |
||||
targets: //python/... //python:python_version |
||||
flags: --define=use_fast_cpp_protos=true |
||||
|
||||
name: MacOS ${{ matrix.type }} ${{ matrix.version }} |
||||
runs-on: macos-12 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Pin Python version |
||||
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 |
||||
with: |
||||
python-version: ${{ matrix.version }} |
||||
cache: pip |
||||
|
||||
- name: Validate version |
||||
run: python3 --version | grep ${{ matrix.version }} || (echo "Invalid Python version - $(python3 --version)" && exit 1) |
||||
|
||||
- name: Create and start virtual environment |
||||
run: | |
||||
python3 -m venv venv |
||||
source venv/bin/activate |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
env: |
||||
KOKORO_PYTHON_VERSION: ${{ matrix.version }} |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: python_macos/${{ matrix.type }}_${{ matrix.version }} |
||||
bazel: >- |
||||
test ${{ matrix.targets }} ${{ matrix.flags }} |
||||
--test_env=KOKORO_PYTHON_VERSION=${{ matrix.version }} |
||||
--macos_minimum_os=10.9 |
@ -0,0 +1,139 @@ |
||||
name: Ruby Tests |
||||
|
||||
on: |
||||
workflow_call: |
||||
inputs: |
||||
safe-checkout: |
||||
required: true |
||||
description: "The SHA key for the commit we want to run over" |
||||
type: string |
||||
|
||||
jobs: |
||||
linux: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
include: |
||||
- { name: Ruby 2.6, ruby: ruby-2.6.0, bazel: 5.1.1} |
||||
- { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1} |
||||
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1} |
||||
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1} |
||||
- { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1} |
||||
- { name: JRuby 9.2, ruby: jruby-9.2.20.1, bazel: 5.1.1} |
||||
- { name: JRuby 9.3, ruby: jruby-9.3.4.0, bazel: 5.1.1} |
||||
- { name: Ruby 2.6 (Bazel6), ruby: ruby-2.6.0, bazel: 6.0.0} |
||||
- { name: JRuby 9.2 (Bazel6), ruby: jruby-9.2.20.1, bazel: 6.0.0} |
||||
|
||||
name: Linux ${{ matrix.name }} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:{0}-{1}-75e79f791b96e056086f43ace729cf3ebf9a9f5d', matrix.ruby, matrix.bazel) }} |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: ruby_linux/${{ matrix.ruby }}_${{ matrix.bazel }} |
||||
bazel: test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION |
||||
|
||||
linux-aarch64: |
||||
name: Linux aarch64 |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Cross compile protoc for aarch64 |
||||
id: cross-compile |
||||
uses: ./.github/actions/cross-compile-protoc |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
architecture: linux-aarch64 |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/docker |
||||
with: |
||||
image: arm64v8/ruby:2.7.3-buster |
||||
skip-staleness-check: true |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
command: >- |
||||
/bin/bash -c ' |
||||
gem install bundler; |
||||
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: |
||||
fail-fast: false # Don't cancel all jobs if one fails. |
||||
matrix: |
||||
# This is the full set of versions we support on MacOS. |
||||
version: [ "2.7", "3.0", "3.1", "3.2" ] |
||||
|
||||
name: MacOS Ruby ${{ matrix.version }} |
||||
runs-on: macos-12 |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
submodules: recursive |
||||
ref: ${{ inputs.safe-checkout }} |
||||
|
||||
- name: Pin Ruby version |
||||
uses: ruby/setup-ruby@ee26e27437bde475b19a6bf8cb73c9fa658876a2 # v1.134.0 |
||||
with: |
||||
ruby-version: ${{ matrix.version }} |
||||
|
||||
- name: Validate version |
||||
run: ruby --version | grep ${{ matrix.version }} || (echo "Invalid Ruby version - $(ruby --version)" && exit 1) |
||||
|
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel |
||||
with: |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: ruby_macos/${{ matrix.version }} |
||||
bazel: test //ruby/... --test_env=KOKORO_RUBY_VERSION=${{ matrix.version }} |
||||
|
||||
test_ruby_gems: |
||||
strategy: |
||||
fail-fast: false |
||||
matrix: |
||||
include: |
||||
- { name: Ruby 2.6, ruby: ruby-2.6.0, bazel: 5.1.1} |
||||
- { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1} |
||||
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1} |
||||
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1} |
||||
- { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1} |
||||
- { name: JRuby 9.2, ruby: jruby-9.2.20.1, bazel: 5.1.1} |
||||
- { name: JRuby 9.3, ruby: jruby-9.3.4.0, bazel: 5.1.1} |
||||
- { name: Ruby 2.6 (Bazel6), ruby: ruby-2.6.0, bazel: 6.0.0} |
||||
- { name: JRuby 9.2 (Bazel6), ruby: jruby-9.2.20.1, bazel: 6.0.0} |
||||
name: Install ${{ matrix.name }} |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout pending changes |
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
||||
with: |
||||
ref: ${{ inputs.safe-checkout }} |
||||
- name: Run tests |
||||
uses: ./.github/actions/bazel-docker |
||||
with: |
||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:${{ matrix.ruby }}-${{ matrix.bazel }}-75e79f791b96e056086f43ace729cf3ebf9a9f5d |
||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} |
||||
bazel-cache: ruby_install/${{ matrix.ruby }}_${{ matrix.bazel }} |
||||
bash: > |
||||
bazel --version; |
||||
ruby --version; |
||||
bazel build //ruby:release //:protoc $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; |
||||
ruby ruby/tests/basic.rb |
||||
|
@ -0,0 +1,161 @@ |
||||
name: Tests |
||||
|
||||
# This file implements the protection strategy laid out in |
||||
# go/protobuf-gha-protected-resources. Pull requests from branches within this |
||||
# repository are considered safe and will immediately start running tests on |
||||
# every commit. Pull requests from forked repositories are unsafe, and leave |
||||
# us vulnerable to PWN requests and stolen resources. In these cases, we |
||||
# require a special "safe for tests" tag to be added to the pull request before |
||||
# we start testing. This will be immediately removed, so that further commits |
||||
# require their own stamp to test. |
||||
|
||||
on: |
||||
# continuous |
||||
schedule: |
||||
# Run daily at 10 AM UTC (2 AM PDT) |
||||
- cron: 0 10 * * * |
||||
|
||||
# postsubmit |
||||
push: |
||||
branches: |
||||
- main |
||||
- '[0-9]+.x' |
||||
# The 21.x branch still uses Kokoro |
||||
- '!21.x' |
||||
# For testing purposes so we can stage this on the `gha` branch. |
||||
- gha |
||||
|
||||
# safe presubmit |
||||
pull_request: |
||||
branches: |
||||
- main |
||||
- '[0-9]+.x' |
||||
# The 21.x branch still uses Kokoro |
||||
- '!21.x' |
||||
# For testing purposes so we can stage this on the `gha` branch. |
||||
- gha |
||||
|
||||
# unsafe presubmit |
||||
pull_request_target: |
||||
branches: |
||||
- main |
||||
- '[0-9]+.x' |
||||
# The 21.x branch still uses Kokoro |
||||
- '!21.x' |
||||
# For testing purposes so we can stage this on the `gha` branch. |
||||
- gha |
||||
types: [labeled, opened, reopened, synchronize] |
||||
|
||||
# manual |
||||
workflow_dispatch: |
||||
|
||||
jobs: |
||||
check-tag: |
||||
name: Check for Safety |
||||
|
||||
# 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 |
||||
# use `pull_request_target`. |
||||
if: | |
||||
(github.event_name == 'push' && |
||||
github.event.repository.full_name == 'protocolbuffers/protobuf') || |
||||
(github.event_name == 'pull_request' && |
||||
github.event.pull_request.head.repo.full_name == 'protocolbuffers/protobuf') || |
||||
(github.event_name == 'pull_request_target' && |
||||
github.event.pull_request.head.repo.full_name != 'protocolbuffers/protobuf') |
||||
|
||||
runs-on: ubuntu-latest |
||||
outputs: |
||||
# 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 }} |
||||
steps: |
||||
- name: Check |
||||
# Trivially pass for safe PRs, and explicitly error for unsafe ones |
||||
# unless this is specifically an event for adding the safe label. |
||||
run: > |
||||
${{ github.event_name != 'pull_request_target' || github.event.label.name == ':a: safe for tests' }} || |
||||
(echo "This pull request is from an unsafe fork and hasn't been approved to run tests!" && exit 1) |
||||
|
||||
- name: Cache safe commit |
||||
id: safe-checkout |
||||
run: > |
||||
${{ github.event_name != 'pull_request_target' }} || |
||||
echo "sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT |
||||
|
||||
remove-tag: |
||||
name: Remove safety tag |
||||
needs: [check-tag] |
||||
if: github.event.action == 'labeled' |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 |
||||
with: |
||||
labels: safe for tests |
||||
|
||||
# Note: this pattern of passing the head sha is vulnerable to PWN requests for |
||||
# pull_request_target events. We carefully limit those workflows to require a |
||||
# human stamp before continuing. |
||||
cpp: |
||||
name: C++ |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_cpp.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
java: |
||||
name: Java |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_java.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
python: |
||||
name: Python |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_python.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
ruby: |
||||
name: Ruby |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_ruby.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
php: |
||||
name: PHP |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_php.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
php-ext: |
||||
name: PHP Extension |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_php_ext.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
csharp: |
||||
name: C# |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_csharp.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
||||
|
||||
objectivec: |
||||
name: Objective-C |
||||
needs: [check-tag] |
||||
uses: ./.github/workflows/test_objectivec.yml |
||||
with: |
||||
safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} |
||||
secrets: inherit |
@ -1,75 +0,0 @@ |
||||
2022-07-01 Unreleased version |
||||
# C++ |
||||
* cpp_generated_lib_linked support is removed in protoc |
||||
* Reduced .pb.o object file size slightly by explicitly instantiating |
||||
InternalMetadata templates in the runtime. |
||||
* Breaking change: Add C++20 reserved keywords. |
||||
* Fixed crash in ThreadLocalStorage for pre-C++17 compilers on 32-bit ARM. |
||||
* Clarified that JSON API non-OK statuses are not a stable API. |
||||
* Added a default implementation of MessageDifferencer::Reporter methods. |
||||
* proto2::MapPair is now an alias to std::pair. |
||||
* Hide C++ RepeatedField::UnsafeArenaSwap |
||||
* Use table-driven parser for reflection based objects. |
||||
* Update Map's InternalSwap() to take a pointer to the other Map. |
||||
* Add ARM-optimized Varint decoding functions. |
||||
* Minor optimization for parsing groups |
||||
* Declare ReflectiveProtoHook class |
||||
* Reduce size of VarintParse code in protocol buffers, by calling the shared |
||||
routine after handling just one-byte varint encoding inline, rather than |
||||
handling one-byte and two-byte varints inline. |
||||
* Avoid inlining some large heavily duplicated routines in repeated_ptr_field.h |
||||
* Add ReflectiveProtoHook to Reflection. |
||||
* Turns on table-driven parser for reflection based objects. |
||||
* Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor. |
||||
* Undefine the macro `linux` when compiling protobuf |
||||
* Reduce memory consumption of MessageSet parsing. |
||||
* Save code space by avoiding inlining of large-in-aggregate code-space MessageLite::~MessageLite destructor. |
||||
* Breaking change: Delete Arena::Init |
||||
* Make a PROTOBUF_POISON/UNPOISON to reduce noise in the source |
||||
* Put alignment functions in "arena_align.h" |
||||
* Split off `cleanup` arena functions into "arena_cleanup.h" |
||||
* Fix signed / unsigned match in CHECK_EQ |
||||
* Kill Atomic<>. it's not pulling it's weight |
||||
* Move AllocationPolicy out of arena_impl, and unify arena_config for bazel |
||||
* Fix failure case in table-driven parser. |
||||
* Add a new JSON parser. |
||||
* Removed old JSON parsing code. |
||||
* Introduce the Printer::{SetRedactDebugString,SetRandomizeDebugString} private flags. |
||||
* Introduce global flags to control Printer::{SetRedactDebugString, SetRandomizeDebugString}. |
||||
* proto3 string fields no longer trigger clang-tidy warning bugprone-branch-clone. |
||||
* Fix the API of DescriptorUpgrader::set_allow_unknown_dependencies to set to True always, and to populate into the DescriptorPool as well. |
||||
* Report line numbers consistently in text-format deprecated-field warnings. |
||||
* Reserve C++20 keywords |
||||
* Fixed C++ code generation for protos that use int32_t, uint32_t, int64_t, uint64_t, size_t as field names. |
||||
* Annotate generated C++ public aliases for enum types. |
||||
* Change default arena max block size from 8K to 32K. |
||||
|
||||
# Kotlin |
||||
* Suppress deprecation warnings in Kotlin generated code. |
||||
* Kotlin generated code comments now use kdoc format instead of javadoc. |
||||
* Escape keywords in package names in proto generated code |
||||
* Add Kotlin enum int value getters and setters |
||||
|
||||
# Java |
||||
* Performance improvement for repeated use of FieldMaskUtil#merge by caching |
||||
constructed FieldMaskTrees. |
||||
* Optimized Java proto serialization gencode for protos having many extension ranges with few fields in between. |
||||
* More thoroughly annotate public generated code in Java lite protocol buffers. |
||||
* Fixed Bug in proto3 java lite repeated enum fields. Failed to call copyOnWrite before modifying previously built message. Causes modification to already "built" messages that should be immutable. |
||||
* Fix Java reflection serialization of empty packed fields. |
||||
* Refactoring java full runtime to reuse sub-message builders and prepare to migrate parsing logic from parse constructor to builder. |
||||
* Move proto wireformat parsing functionality from the private "parsing constructor" to the Builder class. |
||||
* Change the Lite runtime to prefer merging from the wireformat into mutable messages rather than building up a new immutable object before merging. This way results in fewer allocations and copy operations. |
||||
* Make message-type extensions merge from wire-format instead of building up instances and merging afterwards. This has much better performance. |
||||
* Fix TextFormat parser to build up recurring (but supposedly not repeated) sub-messages directly from text rather than building a new sub-message and merging the fully formed message into the existing field. |
||||
* Fix bug in nested builder caching logic where cleared sub-field builders would remain dirty after a clear and build in a parent layer. https://github.com/protocolbuffers/protobuf/issues/10624 |
||||
|
||||
# Python |
||||
* Changes ordering of printed fields in .pyi files from lexicographic to the same ordering found in the proto descriptor. |
||||
* Adds GeneratedCodeInfo annotations to python proto .pyi outputs as a base64 encoded docstring in the last line of the .pyi file for code analysis tools. |
||||
* Fix message factory's behavior in python cpp extension to return same message classes for same descriptor, even if the factories are different. |
||||
* Add type annotation for enum value fields in enum classes. |
||||
|
||||
# Compiler |
||||
* Print full path name of source .proto file on error |
||||
* Include proto message type in the annotation comments. |
@ -0,0 +1,3 @@ |
||||
import common.bazelrc |
||||
|
||||
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 |
@ -0,0 +1,2 @@ |
||||
import common.bazelrc |
||||
|
@ -0,0 +1,3 @@ |
||||
#!/bin/sh |
||||
# This file wraps clang with ccache to enable faster runs of xcodebuild |
||||
ccache clang "$@" |
@ -0,0 +1,3 @@ |
||||
#!/bin/sh |
||||
# This file wraps clang with ccache to enable faster runs of xcodebuild |
||||
ccache clang++ "$@" |
@ -0,0 +1,36 @@ |
||||
# Fail if a glob doesn't match anything (https://github.com/bazelbuild/bazel/issues/8195) |
||||
build --incompatible_disallow_empty_glob |
||||
|
||||
build:dbg --compilation_mode=dbg |
||||
|
||||
build:opt --compilation_mode=opt |
||||
|
||||
build:san-common --config=dbg --strip=never --copt=-O0 --copt=-fno-omit-frame-pointer |
||||
|
||||
build:asan --config=san-common --copt=-fsanitize=address --linkopt=-fsanitize=address |
||||
build:asan --copt=-DADDRESS_SANITIZER=1 |
||||
# ASAN hits ODR violations with shared linkage due to rules_proto. |
||||
build:asan --dynamic_mode=off |
||||
|
||||
build:msan --config=san-common --copt=-fsanitize=memory --linkopt=-fsanitize=memory |
||||
build:msan --copt=-fsanitize-memory-track-origins |
||||
build:msan --copt=-fsanitize-memory-use-after-dtor |
||||
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1 |
||||
build:msan --copt=-DMEMORY_SANITIZER=1 |
||||
|
||||
# Use our instrumented LLVM libc++ in Kokoro. |
||||
build:kokoro-msan --config=msan |
||||
build:kokoro-msan --linkopt=-L/opt/libcxx_msan/lib |
||||
build:kokoro-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib |
||||
build:kokoro-msan --cxxopt=-stdlib=libc++ --linkopt=-stdlib=libc++ |
||||
|
||||
|
||||
build:tsan --config=san-common --copt=-fsanitize=thread --linkopt=-fsanitize=thread |
||||
build:tsan --copt=-DTHREAD_SANITIZER=1 |
||||
|
||||
build:ubsan --config=san-common --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined |
||||
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 |
||||
build:ubsan --copt=-DUNDEFINED_SANITIZER=1 |
||||
# Workaround for the fact that Bazel links with $CC, not $CXX |
||||
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748 |
||||
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr |
@ -0,0 +1,3 @@ |
||||
import common.bazelrc |
||||
|
||||
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 |
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,12 +0,0 @@ |
||||
|
||||
Kokoro Infrastructure |
||||
---------------------- |
||||
|
||||
The files in this directory serve as plumbing for running Protobuf |
||||
tests under Kokoro, our internal CI. |
||||
|
||||
We have shared this part of our CI configuration in hopes that it is |
||||
helpful to contributors who want to better understand the details of |
||||
our test and release processes. If there are changes, please file an |
||||
issue; unfortunately, we may not be able to accept PRs (but feel free |
||||
to send one if it helps to explain the issue). |
@ -1,46 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
# Helper for setting up common bazel flags in Kokoro. |
||||
# |
||||
# This script prints extra flags to a bazel invocation when it is run from |
||||
# Kokoro. When the special environment variables are not present (e.g., if you |
||||
# run Kokoro build scripts locally), this script only flips some debug settings. |
||||
# |
||||
# Example of running directly: |
||||
# bazel test $(path/to/bazel_flags.sh) //... |
||||
|
||||
function bazel_flags::gen_invocation_id() { |
||||
# Create a new invocation ID and store in the artifacts dir. |
||||
local _invocation_id=$(uuidgen | tr A-Z a-z) |
||||
|
||||
# Put the new invocation ID at the start of the output IDs file. Some |
||||
# Google-internal tools only look at the first entry, so this ensures the most |
||||
# recent entry is first. |
||||
local _ids_file=${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids |
||||
local _temp_ids=$(mktemp) |
||||
echo ${_invocation_id} > ${_temp_ids} |
||||
[[ -e ${_ids_file} ]] && cat ${_ids_file} >> ${_temp_ids} |
||||
mv -f ${_temp_ids} ${_ids_file} |
||||
|
||||
echo -n ${_invocation_id} |
||||
} |
||||
|
||||
# Prints flags to use on Kokoro. |
||||
function bazel_flags::kokoro_flags() { |
||||
[[ -n ${KOKORO_JOB_NAME:-} ]] || return |
||||
|
||||
local -a _flags |
||||
_flags+=( |
||||
--invocation_id=$(bazel_flags::gen_invocation_id) |
||||
--remote_cache=https://storage.googleapis.com/protobuf-bazel-cache/${KOKORO_JOB_NAME} |
||||
) |
||||
if [[ -n ${KOKORO_BAZEL_AUTH_CREDENTIAL:-} ]]; then |
||||
_flags+=( --google_credentials=${KOKORO_BAZEL_AUTH_CREDENTIAL} ) |
||||
else |
||||
_flags+=( --google_default_credentials=true ) |
||||
fi |
||||
|
||||
echo "${_flags[@]}" |
||||
} |
||||
|
||||
echo "$(bazel_flags::kokoro_flags) --keep_going --test_output=errors" |
@ -1,92 +0,0 @@ |
||||
# Log capturing for the Kokoro runtime environment. |
||||
# |
||||
# This script should be `source`d from Kokoro build scripts to configure log |
||||
# capturing when running under Kokoro. |
||||
# |
||||
# When not running under Kokoro, no logs will be collected. If you want to run |
||||
# locally and collect logs anyway, set the KOKORO_ARTIFACTS_DIR environment |
||||
# variable to a directory where the logs should go. |
||||
# |
||||
# The job `.cfg` file needs the following stanzas to declare the captured logs |
||||
# as outputs (yes, these are globs, not regexes): |
||||
# |
||||
# action: { |
||||
# define_artifacts: { |
||||
# regex: "**/*sponge_log.log" |
||||
# regex: "**/*sponge_log.xml" |
||||
# } |
||||
# } |
||||
# |
||||
# Use the provided functions below as build/test fixtures, e.g.: |
||||
# |
||||
# source kokoro/common/capture_logs.sh |
||||
# caplog build/step1 <build command> |
||||
# caplog tests/step2 <test command> |
||||
# |
||||
# If log capturing is enabled, this script will set some variables that can be |
||||
# used if necessary: |
||||
# |
||||
# CAPLOG_DIR is used for logs |
||||
# CAPLOG_CMAKE_ARGS contains extra cmake args to enable test XML output |
||||
# CAPLOG_CTEST_ARGS contains extra ctest args to capture combined test logs |
||||
# |
||||
# For example: |
||||
# |
||||
# if [[ -v CAPLOG_DIR_BUILD ]]; then |
||||
# cp extra_diagnostics.log "${CAPLOG_DIR_BUILD}/diagnostics.log" |
||||
# fi |
||||
# |
||||
# # Use ${...:-} form under `set -u`: |
||||
# caplog build/01_configure cmake -G Ninja ${CAPLOG_CMAKE_ARGS:-} |
||||
# caplog build/02_build cmake --build |
||||
# caplog test/03_test ctest ${CAPLOG_CTEST_ARGS:-} |
||||
|
||||
if [[ -z ${KOKORO_ARTIFACTS_DIR:-} ]]; then |
||||
function caplog() { shift; "$@"; } |
||||
else |
||||
|
||||
CAPLOG_DIR="$(mktemp -d)" |
||||
CAPLOG_CMAKE_ARGS="-Dprotobuf_TEST_XML_OUTDIR=${CAPLOG_DIR}/tests/" |
||||
CAPLOG_CTEST_ARGS="--verbose" |
||||
|
||||
# Captures the stdout/stderr of a command to a named log file. |
||||
# Usage: caplog NAME COMMAND [ARGS...] |
||||
function caplog() { |
||||
_name="${CAPLOG_DIR}/${1%.log}.log"; shift |
||||
mkdir -p "${_name%/*}" |
||||
date |
||||
time ( "$@" 2>&1 | tee "${_name}" ) |
||||
if [[ $? != 0 ]] ; then |
||||
cat "${_name}" |
||||
return 1 |
||||
fi |
||||
} |
||||
|
||||
# Trap handler: renames logs on script exit so they will be found by Kokoro. |
||||
function _caplog_onexit() { |
||||
_rc=$? |
||||
set +x |
||||
echo "Collecting logs [${BASH_SOURCE}]" |
||||
|
||||
find "${CAPLOG_DIR}" -type f -name '*.log' \ |
||||
| while read _textlog; do |
||||
# Ensure an XML file exists for each .log file. |
||||
touch ${_textlog%.log}.xml |
||||
done |
||||
|
||||
find "${CAPLOG_DIR}" -type f \( -name '*.xml' -or -name '*.log' \) \ |
||||
| while read _src; do |
||||
# Move to artifacts dir, preserving the path relative to CAPLOG_DIR. |
||||
# The filename changes from foo/bar.log to foo/bar/sponge_log.log. |
||||
_logfile=${_src/${CAPLOG_DIR}\//} |
||||
_stem=${KOKORO_ARTIFACTS_DIR}/${_logfile%.*} |
||||
_ext=${_logfile##*.} |
||||
mkdir -p ${_stem} |
||||
mv -v "${_src}" "${_stem}/sponge_log.${_ext}" |
||||
done |
||||
rm -rv "${CAPLOG_DIR}" |
||||
exit ${_rc} |
||||
} |
||||
trap _caplog_onexit EXIT |
||||
|
||||
fi |
@ -1,85 +0,0 @@ |
||||
#!/bin/bash |
||||
# |
||||
# Build tests under CMake. |
||||
# |
||||
# This script is used from macos and linux builds. It runs cmake and ctest in |
||||
# the current directory. Any additional setup should be done before running this |
||||
# script. |
||||
# |
||||
# This script uses `caplog` to save logfiles. See caplog.sh for details. |
||||
|
||||
set -eu -o pipefail |
||||
: ${SCRIPT_ROOT:=$(cd $(dirname $0)/../..; pwd)} |
||||
|
||||
################################################################################ |
||||
# If you are using this script to run tests, you can set some environment |
||||
# variables to control behavior: |
||||
# |
||||
# By default, find the sources based on this script's path. |
||||
: ${SOURCE_DIR:=${SCRIPT_ROOT}} |
||||
# |
||||
# By default, put outputs under <git root>/cmake/build. |
||||
: ${BUILD_DIR:=${SOURCE_DIR}/cmake/build} |
||||
# |
||||
# CMAKE_BUILD_TYPE is supported in cmake 3.22+. If set, we pass the value of this |
||||
# variable explicitly for compatibility with older versions of cmake. See: |
||||
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html |
||||
# (N.B.: not to be confused with CMAKE_CONFIG_TYPE.) |
||||
if [[ -n ${CMAKE_BUILD_TYPE:-} ]]; then |
||||
CMAKE_BUILD_TYPE_FLAG="-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
||||
else |
||||
CMAKE_BUILD_TYPE_FLAG= |
||||
fi |
||||
# |
||||
# For several other CMake options, see docs here: |
||||
# https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html |
||||
# |
||||
# Some variables you may want to override (see cmake docs for details): |
||||
# CMAKE_BUILD_PARALLEL_LEVEL |
||||
# CMAKE_CONFIG_TYPE (N.B.: not to be confused with CMAKE_BUILD_TYPE) |
||||
# CMAKE_GENERATOR |
||||
# CTEST_PARALLEL_LEVEL |
||||
################################################################################ |
||||
|
||||
echo "Building using..." |
||||
echo " Sources: ${SOURCE_DIR}" |
||||
echo " Build output: ${BUILD_DIR}" |
||||
if [[ ${SOURCE_DIR} != ${SCRIPT_ROOT} ]]; then |
||||
echo " Build scripts: ${SCRIPT_ROOT}" |
||||
fi |
||||
set -x |
||||
source ${SCRIPT_ROOT}/kokoro/common/caplog.sh |
||||
|
||||
# |
||||
# Configure under $BUILD_DIR: |
||||
# |
||||
mkdir -p "${BUILD_DIR}" |
||||
|
||||
( |
||||
cd "${BUILD_DIR}" |
||||
caplog 01_configure \ |
||||
cmake -S "${SOURCE_DIR}" \ |
||||
${CMAKE_BUILD_TYPE_FLAG} \ |
||||
${CAPLOG_CMAKE_ARGS:-} \ |
||||
-DCMAKE_CXX_STANDARD=14 |
||||
) |
||||
if [[ -n ${CAPLOG_DIR:-} ]]; then |
||||
# Save configuration logs. |
||||
mkdir -p "${CAPLOG_DIR}/CMakeFiles" |
||||
cp "${BUILD_DIR}"/CMakeFiles/CMake*.log "${CAPLOG_DIR}/CMakeFiles" |
||||
fi |
||||
|
||||
# |
||||
# Build: |
||||
# |
||||
caplog 02_build \ |
||||
cmake --build "${BUILD_DIR}" |
||||
|
||||
# |
||||
# Run tests |
||||
# |
||||
( |
||||
cd "${BUILD_DIR}" |
||||
caplog 03_combined_testlog \ |
||||
ctest ${CAPLOG_CTEST_ARGS:-} |
||||
) |
@ -1,11 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
set -eux |
||||
|
||||
# Upgrade to a supported gcc version |
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
||||
sudo apt-get -y update && \ |
||||
sudo apt-get install --no-install-recommends -y --fix-missing --option Acquire::Retries=10 --option Acquire::http::Timeout="1800" \ |
||||
gcc-7 g++-7 |
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 --slave /usr/bin/g++ g++ /usr/bin/g++-7 |
||||
sudo update-alternatives --set gcc /usr/bin/gcc-7 |
@ -1,44 +0,0 @@ |
||||
# Format: //devtools/kokoro/config/proto/build.proto |
||||
|
||||
# Build logs will be here |
||||
action { |
||||
define_artifacts { |
||||
regex: "**/*sponge_log.xml" |
||||
} |
||||
} |
||||
|
||||
# Download trampoline resources. |
||||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" |
||||
|
||||
# Use the trampoline script to run in docker. |
||||
build_file: "protobuf/kokoro/docs/trampoline.sh" |
||||
|
||||
# Configure the docker image for kokoro-trampoline. |
||||
env_vars: { |
||||
key: "TRAMPOLINE_IMAGE" |
||||
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" |
||||
} |
||||
|
||||
env_vars: { |
||||
key: "STAGING_BUCKET" |
||||
value: "docs-staging" |
||||
} |
||||
|
||||
# Fetch the token needed for reporting release status to GitHub |
||||
before_action { |
||||
fetch_keystore { |
||||
keystore_resource { |
||||
keystore_config_id: 73713 |
||||
keyname: "yoshi-automation-github-key" |
||||
} |
||||
} |
||||
} |
||||
|
||||
before_action { |
||||
fetch_keystore { |
||||
keystore_resource { |
||||
keystore_config_id: 73713 |
||||
keyname: "docuploader_service_account" |
||||
} |
||||
} |
||||
} |
@ -1,51 +0,0 @@ |
||||
#!/bin/bash |
||||
# Adapted from https://github.com/googleapis/google-cloud-python/blob/main/.kokoro/publish-docs.sh |
||||
|
||||
set -eo pipefail |
||||
|
||||
# Disable buffering, so that the logs stream through. |
||||
export PYTHONUNBUFFERED=1 |
||||
|
||||
cd github/protobuf/python |
||||
|
||||
# install package |
||||
sudo apt-get update |
||||
sudo apt-get -y install software-properties-common |
||||
sudo add-apt-repository universe |
||||
sudo apt-get update |
||||
sudo apt-get -y install unzip |
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v21.1/protoc-21.1-linux-x86_64.zip |
||||
unzip protoc-21.1-linux-x86_64.zip bin/protoc |
||||
mv bin/protoc ../protoc |
||||
python3 -m venv venv |
||||
source venv/bin/activate |
||||
python setup.py install |
||||
|
||||
# install docs dependencies |
||||
python -m pip install -r docs/requirements.txt |
||||
|
||||
# build docs |
||||
cd docs |
||||
make html |
||||
cd .. |
||||
deactivate |
||||
|
||||
python3 -m pip install protobuf==4.21.1 gcp-docuploader==0.6.3 |
||||
|
||||
# install a json parser |
||||
sudo apt-get -y install jq |
||||
|
||||
# create metadata |
||||
python3 -m docuploader create-metadata \ |
||||
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \ |
||||
--version=$(python3 setup.py --version) \ |
||||
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \ |
||||
--distribution-name=$(python3 setup.py --name) \ |
||||
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \ |
||||
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \ |
||||
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json) |
||||
|
||||
cat docs.metadata |
||||
|
||||
# upload docs |
||||
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging |
@ -1,7 +0,0 @@ |
||||
# Format: //devtools/kokoro/config/proto/build.proto |
||||
|
||||
# Tell the trampoline which build file to use. |
||||
env_vars: { |
||||
key: "TRAMPOLINE_BUILD_FILE" |
||||
value: "github/protobuf/kokoro/docs/publish-python.sh" |
||||
} |
@ -1,11 +0,0 @@ |
||||
#!/bin/bash |
||||
# Copied from https://github.com/googleapis/google-cloud-python/blob/main/.kokoro/trampoline.sh |
||||
|
||||
set -eo pipefail |
||||
|
||||
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$? |
||||
|
||||
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh |
||||
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true |
||||
|
||||
exit ${ret_code} |
@ -1,29 +0,0 @@ |
||||
#!/bin/bash |
||||
# |
||||
# This is the top-level script we give to Kokoro as the entry point for |
||||
# running the "pull request 32" project: |
||||
# |
||||
# This script selects a specific Dockerfile (for building a Docker image) and |
||||
# a script to run inside that image. |
||||
|
||||
set -ex |
||||
|
||||
# Change to repo root |
||||
cd $(dirname $0)/../../.. |
||||
GIT_REPO_ROOT=$(pwd) |
||||
|
||||
CONTAINER_IMAGE=us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:6651a299483f7368876db7aed0802ad4ebf038d626d8995ba7df08978ff43210 |
||||
|
||||
git submodule update --init --recursive |
||||
use_bazel.sh 5.1.1 |
||||
sudo ./kokoro/common/setup_kokoro_environment.sh |
||||
./regenerate_stale_files.sh |
||||
|
||||
gcloud components update --quiet |
||||
gcloud auth configure-docker us-docker.pkg.dev --quiet |
||||
|
||||
docker run \ |
||||
"$@" \ |
||||
-v $GIT_REPO_ROOT:/workspace \ |
||||
$CONTAINER_IMAGE \ |
||||
bash -l "/workspace/kokoro/linux/32-bit/test_php.sh" |
@ -1,11 +0,0 @@ |
||||
# Config file for running tests in Kokoro |
||||
|
||||
# Location of the build script in repository |
||||
build_file: "protobuf/kokoro/linux/32-bit/build.sh" |
||||
timeout_mins: 120 |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "**/sponge_log.xml" |
||||
} |
||||
} |
@ -1 +0,0 @@ |
||||
# Keep this file empty! Use common.cfg instead. |
@ -1 +0,0 @@ |
||||
# Keep this file empty! Use common.cfg instead. |
@ -1,57 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
set -eux |
||||
|
||||
# Change to repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
use_php() { |
||||
VERSION=$1 |
||||
export PATH=/usr/local/php-${VERSION}/bin:$PATH |
||||
} |
||||
|
||||
build_php() { |
||||
use_php $1 |
||||
pushd php |
||||
rm -rf vendor |
||||
php -v |
||||
php -m |
||||
composer update |
||||
composer test |
||||
popd |
||||
} |
||||
|
||||
test_php_c() { |
||||
pushd php |
||||
rm -rf vendor |
||||
php -v |
||||
php -m |
||||
composer update |
||||
composer test_c |
||||
popd |
||||
} |
||||
|
||||
build_php_c() { |
||||
use_php $1 |
||||
test_php_c |
||||
} |
||||
|
||||
mkdir -p build |
||||
pushd build |
||||
cmake .. -DCMAKE_CXX_STANDARD=14 |
||||
cmake --build . -- -j20 |
||||
ctest --verbose --parallel 20 |
||||
export PROTOC=$(pwd)/protoc |
||||
popd |
||||
|
||||
git config --global --add safe.directory "*" |
||||
|
||||
build_php 7.4 |
||||
build_php 8.0 |
||||
build_php_c 7.4 |
||||
build_php_c 8.0 |
||||
build_php_c 7.4-zts |
||||
build_php_c 8.0-zts |
||||
|
||||
# Cleanup after CMake build |
||||
rm -rf build |
@ -1,27 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
# go to the repo root |
||||
cd $(dirname $0)/../../../.. |
||||
GIT_REPO_ROOT=`pwd` |
||||
|
||||
if [[ -t 0 ]]; then |
||||
DOCKER_TTY_ARGS="-it" |
||||
else |
||||
# The input device on kokoro is not a TTY, so -it does not work. |
||||
DOCKER_TTY_ARGS= |
||||
fi |
||||
|
||||
# Pin the dockcross image since newer versions of the image break the build |
||||
# We use an older version of dockcross image that has gcc4.9.4 because it was built |
||||
# before https://github.com/dockcross/dockcross/pull/449 |
||||
# Thanks to that, wheel build with this image aren't actually |
||||
# compliant with manylinux2014, but only with manylinux_2_24 |
||||
PINNED_DOCKCROSS_IMAGE_VERSION=quay.io/pypa/manylinux2014_aarch64:2022-12-10-a8f854a |
||||
|
||||
# running dockcross image without any arguments generates a wrapper |
||||
# scripts that can be used to run commands under the dockcross image |
||||
# easily. |
||||
# See https://github.com/dockcross/dockcross#usage for details |
||||
docker run -v $GIT_REPO_ROOT:/workspace --rm $PINNED_DOCKCROSS_IMAGE_VERSION /bin/bash -c "cd /workspace; git config --global --add safe.directory '*'; $@" |
@ -1,18 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
# Install composer |
||||
curl -sS https://getcomposer.org/installer | php |
||||
mkdir -p "$HOME/bin" |
||||
mv composer.phar "$HOME/bin/composer" |
||||
PATH="$HOME/bin:$PATH" |
||||
|
||||
# go to the repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
cd php |
||||
|
||||
composer install |
||||
composer test |
||||
composer test_c |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue