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.

207 lines
7.0 KiB

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
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
- 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
- name: 8.1 Valgrind
version: 8.1.14-dbg
version-short: "8.1"
command: composer test_valgrind
- name: 8.3 Optimized
version: "8.3.1"
version-short: "8.3"
command: composer test \&\& composer test_c
name: Linux ${{ matrix.name}}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v2
with:
cache-prefix: php-${{ matrix.version-short }}
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v2
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.version }}-66964dc8b07b6d1fc73a5cc14e59e84c1c534cea
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache
command: ${{ matrix.command }}
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'
- 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:836f2cedcfe351d9a30055076630408e61994fc7d783e8333a99570968990eeb
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- name: Cross compile protoc for i386
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v2
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-i386
- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v2
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v2
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-latest
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- name: Cross compile protoc for aarch64
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v2
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-aarch64
- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v2
with:
cache-prefix: php-8.1
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v2
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'
macos:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
# TODO: Add back 8.2 once
# https://github.com/shivammathur/setup-php/issues/823 is fixed.
version: ['8.3']
name: MacOS PHP ${{ matrix.version }}
runs-on: macos-12
steps:
- name: Checkout pending changes
uses: protocolbuffers/protobuf-ci/checkout@v2
with:
ref: ${{ inputs.safe-checkout }}
- name: Uninstall problematic libgd
run: brew uninstall --ignore-dependencies gd
- name: Install dependencies
run: brew install coreutils gd
- name: Pin PHP version
Bump shivammathur/setup-php from 2.24.0 to 2.26.0 (#14115) Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.24.0 to 2.26.0. <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.26.0</h2> <h2>Changelog</h2> <h3>Microsoft SQL Server extensions. (<a href="https://redirect.github.com/shivammathur/setup-php/issues/758">#758</a>, <a href="https://redirect.github.com/shivammathur/setup-php/issues/766">#766</a>)</h3> <p>The latest supported version of <code>sqlsrv</code> and <code>pdo_sqlsrv</code> for the PHP version will be installed. Also, on Windows, these extensions will be installed from <a href="https://github.com/microsoft/msphpsql"><code>microsoft/msphpsql</code></a> GitHub releases and will fallback to <code>pecl</code>.</p> <pre lang="yaml"><code>- name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.2' extensions: sqlsrv, pdo_sqlsrv </code></pre> <h3>PHP 8.4 Support (<a href="https://redirect.github.com/shivammathur/setup-php/issues/762">#762</a>)</h3> <p>Added support for PHP <code>8.4.0-dev</code> from the master branch of <a href="https://github.com/php/php-src"><code>php/php-src</code></a> for all supported OS. <strong>Note</strong>: PHP <code>8.3.0-dev</code> is now built from the new <a href="https://github.com/php/php-src/tree/PHP-8.3"><code>PHP-8.3</code></a> branch.</p> <pre lang="yaml"><code>- name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.4' </code></pre> <h2>Fixes</h2> <h3>Blackfire Player</h3> <p>Resolved issues affecting the <code>blackfire-player</code> on Linux and macOS. It now installs the <code>uuid</code> extension that is required for the tool. Dropped support for it on Windows as <code>uuid</code> extension is not available for the OS.</p> <pre lang="yaml"><code>- name: Setup PHP uses: shivammathur/setup-php@v2 with: tools: blackfire-player </code></pre> <h2>Updates</h2> <h3>Update actions/checkout</h3> <p>Updated the use of <code>actions/checkout</code> to v4 in the documentation and workflows.</p> <pre lang="yaml"><code>- name: Checkout uses: actions/checkout@v4 </code></pre> <h3>Update Node.js Version</h3> <p><strong>Note</strong>: Node.js 16 reached End-of-Life on 2023-09-11 (<a href="https://nodejs.dev/en/about/releases/">Ref</a>).</p> <p>Updated <code>action.yml</code> to use the <code>node20</code> binary. If you use <code>setup-php</code> on a self-hosted runner, please make sure it is <a href="https://github.com/actions/runner/releases/tag/v2.308.0">v2.308.0</a> or newer to use this release or the major version tag <code>v2</code>.</p> <h3>Node.js Dependencies</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/shivammathur/setup-php/commit/7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067"><code>7fdd3ec</code></a> Fix blackfire-player on Linux and macOS</li> <li><a href="https://github.com/shivammathur/setup-php/commit/0de5aa91400e2db529648700b926d7aadd90e9fa"><code>0de5aa9</code></a> Bump version to 2.26.0</li> <li><a href="https://github.com/shivammathur/setup-php/commit/a6e0b1404f31fa05f9b714a9a22fdff096e0a9ea"><code>a6e0b14</code></a> Bump Node.js dependencies</li> <li><a href="https://github.com/shivammathur/setup-php/commit/5d259c66b1a041c1f8f934fb0e75bfaed72edd03"><code>5d259c6</code></a> Bump node version to 20 in action.yml</li> <li><a href="https://github.com/shivammathur/setup-php/commit/62078293612f15211cd9f3e4fb2c36776c1d8742"><code>6207829</code></a> Update use of actions/checkout to v4</li> <li><a href="https://github.com/shivammathur/setup-php/commit/319feb83c2cac73226f628f88f3871021be36bbd"><code>319feb8</code></a> Add support to install sqlsrv and pdo_sqlsrv from GitHub releases</li> <li><a href="https://github.com/shivammathur/setup-php/commit/661ad4bf75a922a7dace4e84776dc0666997484b"><code>661ad4b</code></a> Fix enabling latest pecl extensions</li> <li><a href="https://github.com/shivammathur/setup-php/commit/04c15e2314eb2fe14d9c72a4980e5de39bbe586c"><code>04c15e2</code></a> Remove hardcoded latest version for sqlsrv and pdo_sqlsrv</li> <li><a href="https://github.com/shivammathur/setup-php/commit/5aa416d77b0ac6a16af87d8bfc23819288844fd0"><code>5aa416d</code></a> Merge pull request <a href="https://redirect.github.com/shivammathur/setup-php/issues/766">#766</a> from GrahamCampbell/patch-1</li> <li><a href="https://github.com/shivammathur/setup-php/commit/a9a661ccd431b88b57d08869e0f11f98ecd63033"><code>a9a661c</code></a> Use sqlsvr 5.11.1 on PHP 8</li> <li>Additional commits viewable in <a href="https://github.com/shivammathur/setup-php/compare/d30ad8b1843ace22e6698ab99bbafaa747b6bd0d...7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067">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.24.0&new-version=2.26.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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> Closes #14115 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14115 from protocolbuffers:dependabot/github_actions/shivammathur/setup-php-2.26.0 f4423b44f0aaa553702ec57ac5452a4358e078ad PiperOrigin-RevId: 573315535
1 year ago
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # 2.26.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: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v2
with:
cache-prefix: php-${{ matrix.version }}
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/bash@v2
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: |
pushd php
php -v
php -m
composer update
composer test_c
popd
- name: Run conformance tests
uses: protocolbuffers/protobuf-ci/bazel@v2
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_macos/${{ matrix.version }}
bazel: test //php:conformance_test_c --action_env=PATH --test_env=PATH