Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
9.5 KiB

name: PHP Tests
on:
workflow_call:
inputs:
continuous-run:
required: true
description: "Boolean string denoting whether this run is continuous --
empty string for presubmit, non-empty string for continuous."
type: string
safe-checkout:
required: true
description: "The SHA key for the commit we want to run over"
type: string
continuous-prefix:
required: true
description: "The string continuous-only tests should be prefixed with when displaying test
results."
type: string
permissions:
contents: read
jobs:
linux:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
include:
- name: 8.1 Optimized
version: "8.1.14"
version-short: "8.1"
command: composer test \&\& composer test_c
- name: 8.1 Debug
version: 8.1.14-dbg
version-short: "8.1"
command: composer test \&\& composer test_c
continuous-only: true
- name: 8.1 Memory Leak
version: 8.1.14-dbg
version-short: "8.1"
# Run specialized memory leak & multirequest tests.
command: composer test_c \&\& tests/multirequest.sh \&\& tests/memory_leak_test.sh
continuous-only: true
- name: 8.1 Valgrind
version: 8.1.14-dbg
version-short: "8.1"
command: composer test_valgrind
continuous-only: true
- name: 8.3 Optimized
version: "8.3.1"
version-short: "8.3"
command: composer test \&\& composer test_c
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux ${{ matrix.name}}
runs-on: ubuntu-22-4core
steps:
- name: Checkout pending changes
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Setup composer
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version-short }}
directory: php
- name: Run tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:6.4.0-${{ matrix.version }}-27cf7b86212020d7e552bc13b1e084abb971da75
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache
command: ${{ matrix.command }}
- name: Run conformance tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:6.4.0-${{ matrix.version }}-27cf7b86212020d7e552bc13b1e084abb971da75
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_linux/${{ matrix.version }}
bazel: test //php:conformance_test //php:conformance_test_c --action_env=PATH --test_env=PATH
linux-32bit:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
version: ['8.1']
suffix: [ '', '-zts']
test: ['test', 'test_c']
exclude:
- suffix: '-zts'
test: 'test'
include:
- suffix: '-zts'
suffix_name: ' Thread Safe'
continuous-only: true
- test: 'test_c'
test_name: ' Extension'
continuous-only: true
- suffix: ''
test: 'test'
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} Linux 32-bit ${{ matrix.version}}${{ matrix.suffix_name }}${{ matrix.test_name }}
runs-on: ubuntu-22-4core
env:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:429f924aec315704b4233adcbe4b29006116f27769db98acd176b9eb69c31299
steps:
- name: Checkout pending changes
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Cross compile protoc for i386
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.4.0-cf84e92285ca133b9c8104ad7b14d70e953cbb8e
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-i386
- name: Setup composer
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: ${{ env.image }}
platform: linux/386
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
command: >-
/bin/bash -cex '
PATH="/usr/local/php-${{ matrix.version }}${{matrix.suffix}}/bin:$PATH";
cd php && php -v && php -m;
composer update --ignore-platform-reqs;
composer ${{ matrix.test }}'
linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-22-4core
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Cross compile protoc for aarch64
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.4.0-cf84e92285ca133b9c8104ad7b14d70e953cbb8e
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-aarch64
- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-8.1
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v3
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-aarch64@sha256:77ff9fdec867bbfb290ee0b10d8b7a3e5e434155daa5ec93de7341c7592b858d
platform: linux/arm64
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
command: >-
-c '
cd php;
composer update --ignore-platform-reqs;
composer test;
composer test_c'
- name: Run conformance tests
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_linux/${{ matrix.version }}
bazel: test //php:conformance_test //php:conformance_test_c --action_env=PATH --test_env=PATH
macos:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
include:
- version: '8.3'
name: ${{ matrix.continuous-only && inputs.continuous-prefix || '' }} MacOS PHP ${{ matrix.version }}
# noop
runs-on: macos-13
steps:
- name: Checkout pending changes
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/checkout@v3
with:
ref: ${{ inputs.safe-checkout }}
- name: Uninstall problematic libgd
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: brew uninstall --ignore-dependencies gd
- name: Install dependencies
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: brew install coreutils gd
- name: Pin PHP version
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
Bump shivammathur/setup-php from 2.30.2 to 2.31.1 (#17855) Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.30.2 to 2.31.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/shivammathur/setup-php/releases">shivammathur/setup-php's releases</a>.</em></p> <blockquote> <h2>2.31.1</h2> <h2>Changelog</h2> <ul> <li> <p>Fix installing PECL extensions on Windows with a build version <a href="https://redirect.github.com/shivammathur/setup-php/issues/855">#855</a></p> </li> <li> <p>Fix cache support for ioncube extension <a href="https://redirect.github.com/shivammathur/setup-php/issues/856">#856</a></p> </li> <li> <p>Updated Node.js dependencies.</p> </li> </ul> <p>For the complete list of changes, please refer to the <a href="https://github.com/shivammathur/setup-php/compare/2.31.0...2.31.1">Full Changelog</a></p> <!-- raw HTML omitted --> <h2>2.31.0</h2> <h2>Changelog</h2> <ul> <li> <p>Added support for a fallback mirror for <code>ondrej/php</code> PPA when launchpad is down (<a href="https://redirect.github.com/shivammathur/setup-php/issues/834">#834</a>).</p> </li> <li> <p>Fixed installing packages on self-hosted environments with existing conf files (<a href="https://redirect.github.com/shivammathur/setup-php/issues/852">#852</a>).</p> </li> <li> <p>Fixed support for <code>oci8</code> and <code>pdo_oci</code> extensions on <code>ubuntu-24.04</code>.</p> </li> <li> <p>Fixed support for <code>couchbase</code> extension on <code>ubuntu-24.04</code>.</p> </li> <li> <p>Fixed support for <code>ubuntu-24.04</code> after <code>apt-fast</code> was dropped from the GA images.</p> </li> <li> <p>Fixed support for <code>firebird</code> extension on <code>macos-14</code></p> </li> <li> <p>Fixed support for <code>blackfire</code> extension on <code>macos-14</code>.</p> </li> <li> <p>Fixed support for <code>relay</code> extension.</p> </li> <li> <p>Fixed support for <code>phalcon</code> extension for PHP 7.4 on Ubuntu.</p> </li> <li> <p>Updated Node.js dependencies.</p> </li> </ul> <p>For the complete list of changes, please refer to the <a href="https://github.com/shivammathur/setup-php/compare/2.30.5...2.31.0">Full Changelog</a></p> <!-- raw HTML omitted --> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/shivammathur/setup-php/commit/c541c155eee45413f5b09a52248675b1a2575231"><code>c541c15</code></a> Bump version 2.31.1</li> <li><a href="https://github.com/shivammathur/setup-php/commit/afff805ea318c148735d2a1e88142d355311db2f"><code>afff805</code></a> Fix cache support for ioncube</li> <li><a href="https://github.com/shivammathur/setup-php/commit/594bd591ec5fc2a0913e1e6c6eba2bd60844146b"><code>594bd59</code></a> Fix version regex in Add-Extension</li> <li><a href="https://github.com/shivammathur/setup-php/commit/2e947f1f6932d141d076ca441d0e1e881775e95b"><code>2e947f1</code></a> Bump version to 2.31.0</li> <li><a href="https://github.com/shivammathur/setup-php/commit/2a5212466ca8f626f5b334783f6a2e7438e75326"><code>2a52124</code></a> Add fallback mirror for php PPA when launchpad is down</li> <li><a href="https://github.com/shivammathur/setup-php/commit/9c28f9ba587c1e599886cf2b685ff26dd7addd29"><code>9c28f9b</code></a> Fix support for phalcon on PHP 7.4</li> <li><a href="https://github.com/shivammathur/setup-php/commit/b9f1db485f39c53ecca24779b3a729cd00984f07"><code>b9f1db4</code></a> Improve support for firebird</li> <li><a href="https://github.com/shivammathur/setup-php/commit/588b5da142b3dead73b8f5eeb3f59fad3897a197"><code>588b5da</code></a> Fix support for couchbase on Ubuntu 24.04</li> <li><a href="https://github.com/shivammathur/setup-php/commit/a0edbac27b47c328458bf513e641d65bf3dbb4b3"><code>a0edbac</code></a> Fix support for blackfire</li> <li><a href="https://github.com/shivammathur/setup-php/commit/606ac25b8439b7f029cd0978e1e776843d7bd400"><code>606ac25</code></a> Fix oci extension support on Ubuntu 24.04</li> <li>Additional commits viewable in <a href="https://github.com/shivammathur/setup-php/compare/8872c784b04a1420e81191df5d64fbd59d3d3033...c541c155eee45413f5b09a52248675b1a2575231">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shivammathur/setup-php&package-manager=github_actions&previous-version=2.30.2&new-version=2.31.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. Closes #17855 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17855 from protocolbuffers:dependabot/github_actions/shivammathur/setup-php-2.31.1 5cdf92ee64c93ec3ad79a48c58048fc2b2dd30cc PiperOrigin-RevId: 684962209
2 months ago
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # 2.31.1
with:
php-version: ${{ matrix.version }}
- name: Check PHP version
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: php --version | grep ${{ matrix.version }} || (echo "Invalid PHP version - $(php --version)" && exit 1)
- name: Setup composer
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/composer-setup@v3
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bash@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: |
pushd php
php -v
php -m
composer update
composer test_c
popd
- name: Run conformance tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
uses: protocolbuffers/protobuf-ci/bazel@v3
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_macos/${{ matrix.version }}
bazel: test //php:conformance_test //php:conformance_test_c --action_env=PATH --test_env=PATH