From 8a461b67f11a4167bf45c07f6475f13074752c3a Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Tue, 28 Jul 2026 20:09:10 +0000 Subject: [PATCH 1/9] add cache for grpc for showcase tests --- .../workflows/conformance-tests-gax-showcase.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 2030178cb6c..448d48a4782 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -18,6 +18,20 @@ jobs: - name: Checkout code uses: actions/checkout@v7 + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: '8.2' + extensions: grpc-1.83.0 + key: cache-key-1 #increment to bust the cache + + - name: Cache extensions + uses: actions/cache@v4 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: From cf22b48acad17db5b5956ec2f2ebe7bdd3bf1fa0 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Tue, 28 Jul 2026 21:25:03 +0000 Subject: [PATCH 2/9] Update the cache key name --- .github/workflows/conformance-tests-gax-showcase.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 448d48a4782..2cd888434e0 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -24,7 +24,7 @@ jobs: with: php-version: '8.2' extensions: grpc-1.83.0 - key: cache-key-1 #increment to bust the cache + key: cache-key-grpc-1.38 - name: Cache extensions uses: actions/cache@v4 From 64644b5c745083baf5553ea93a6a84b47152f199 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Tue, 28 Jul 2026 22:09:56 +0000 Subject: [PATCH 3/9] add a flag for make --- .../conformance-tests-gax-showcase.yaml | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 2cd888434e0..96e9aad7304 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -18,25 +18,30 @@ jobs: - name: Checkout code uses: actions/checkout@v7 - - name: Setup cache environment - id: extcache - uses: shivammathur/cache-extensions@v1 + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: php-version: '8.2' - extensions: grpc-1.83.0 - key: cache-key-grpc-1.38 - - name: Cache extensions + - name: Get PHP Extension Directory + id: php-info + run: | + echo "ext_dir=$(php-config --extension-dir)" >> $GITHUB_OUTPUT + echo "ini_dir=$(php -r 'echo ini_get("scan_dir");')" >> $GITHUB_OUTPUT + + - name: Cache gRPC Extension + id: cache-grpc uses: actions/cache@v4 with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} + path: | + ${{ steps.php-info.outputs.ext_dir }}/grpc.so + ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini + key: grpc-1.83.0-php8.2-v1 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: grpc-1.83.0 + - name: Install gRPC Extension + if: steps.cache-grpc.outputs.cache-hit != 'true' + run: | + sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 - name: Install and run GAPIC Showcase run: | From ce9e81e248a1c8f863f74c9da2125fbcc5a9b003 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 00:36:51 +0000 Subject: [PATCH 4/9] remove the extension declaration under the php setup and recreated it manually --- .github/workflows/conformance-tests-gax-showcase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 96e9aad7304..ef344614170 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -42,6 +42,7 @@ jobs: if: steps.cache-grpc.outputs.cache-hit != 'true' run: | sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini - name: Install and run GAPIC Showcase run: | From 6993e8ea69845e4c2a4e2a82de4ca0dfe6704e94 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 00:55:41 +0000 Subject: [PATCH 5/9] Cache compiled gRPC 1.83.0 PECL extension and speed up showcase tests --- .github/workflows/conformance-tests-gax-showcase.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index ef344614170..77c34a31a01 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -33,16 +33,18 @@ jobs: id: cache-grpc uses: actions/cache@v4 with: - path: | - ${{ steps.php-info.outputs.ext_dir }}/grpc.so - ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini - key: grpc-1.83.0-php8.2-v1 + path: ${{ steps.php-info.outputs.ext_dir }}/grpc.so + key: grpc-1.83.0-php8.2-v2 - name: Install gRPC Extension if: steps.cache-grpc.outputs.cache-hit != 'true' run: | sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + + - name: Enable gRPC Extension + run: | echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini + php -m | grep grpc - name: Install and run GAPIC Showcase run: | From 9ddbe0339da223e4cdfb031022d5d91cd35100ba Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 01:23:12 +0000 Subject: [PATCH 6/9] Updated the script to cache the grpc extension --- .../conformance-tests-gax-showcase.yaml | 105 +++++++++--------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 77c34a31a01..26bd2bc1ce8 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -7,54 +7,57 @@ on: permissions: contents: read jobs: - gapic-showcase: - runs-on: ubuntu-latest - env: - GAPIC_SHOWCASE_VERSION: 0.42.0 - OS: linux - ARCH: amd64 - name: GAPIC Showcase Conformance Tests - steps: - - name: Checkout code - uses: actions/checkout@v7 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - - - name: Get PHP Extension Directory - id: php-info - run: | - echo "ext_dir=$(php-config --extension-dir)" >> $GITHUB_OUTPUT - echo "ini_dir=$(php -r 'echo ini_get("scan_dir");')" >> $GITHUB_OUTPUT - - - name: Cache gRPC Extension - id: cache-grpc - uses: actions/cache@v4 - with: - path: ${{ steps.php-info.outputs.ext_dir }}/grpc.so - key: grpc-1.83.0-php8.2-v2 - - - name: Install gRPC Extension - if: steps.cache-grpc.outputs.cache-hit != 'true' - run: | - sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 - - - name: Enable gRPC Extension - run: | - echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini - php -m | grep grpc - - - name: Install and run GAPIC Showcase - run: | - curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx - ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & - sleep 2 - - - name: Install dependencies - run: | - composer update --prefer-dist --no-interaction --no-suggest -d Gax/ - - - name: Run PHPUnit - run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist + gapic-showcase: + name: GAPIC Showcase Conformance Tests + runs-on: ubuntu-latest + env: + GAPIC_SHOWCASE_VERSION: 0.42.0 + OS: linux + ARCH: amd64 + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Get PHP Extension Directory + id: php-info + run: | + echo "ext_dir=$(php-config --extension-dir)" >> $GITHUB_OUTPUT + ini_dir=$(php --ini | grep "Scan this dir" | cut -d: -f2 | xargs) + if [ -z "$ini_dir" ]; then ini_dir="/etc/php/8.2/cli/conf.d"; fi + echo "ini_dir=$ini_dir" >> $GITHUB_OUTPUT + + - name: Cache gRPC Extension + id: cache-grpc + uses: actions/cache@v4 + with: + path: ${{ steps.php-info.outputs.ext_dir }}/grpc.so + key: grpc-1.83.0-php8.2-v2 + + - name: Install gRPC Extension + if: steps.cache-grpc.outputs.cache-hit != 'true' + run: | + sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + + - name: Enable gRPC Extension + run: | + echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini + php -m | grep grpc + + - name: Install and run GAPIC Showcase + run: | + curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx + ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & + sleep 2 + + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-suggest -d Gax/ + + - name: Run PHPUnit + run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist + From c3ebf88de4cce0d9772b0eb9b34118b9f798c4ae Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 01:47:24 +0000 Subject: [PATCH 7/9] Modify the cache folder path --- .github/workflows/conformance-tests-gax-showcase.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 26bd2bc1ce8..14b687aa99e 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -35,16 +35,19 @@ jobs: id: cache-grpc uses: actions/cache@v4 with: - path: ${{ steps.php-info.outputs.ext_dir }}/grpc.so - key: grpc-1.83.0-php8.2-v2 + path: ~/.cache/grpc.so + key: grpc-1.83.0-php8.2-v3 - name: Install gRPC Extension if: steps.cache-grpc.outputs.cache-hit != 'true' run: | sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + mkdir -p ~/.cache + cp ${{ steps.php-info.outputs.ext_dir }}/grpc.so ~/.cache/grpc.so - name: Enable gRPC Extension run: | + sudo cp ~/.cache/grpc.so ${{ steps.php-info.outputs.ext_dir }}/grpc.so echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini php -m | grep grpc From b7609b04ecdf878297b98687f70dd1ca973b6c07 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 19:37:40 +0000 Subject: [PATCH 8/9] change indentation to 4 spaces --- .../conformance-tests-gax-showcase.yaml | 97 +++++++++---------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 14b687aa99e..0e38646ef1c 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -7,60 +7,59 @@ on: permissions: contents: read jobs: - gapic-showcase: - name: GAPIC Showcase Conformance Tests - runs-on: ubuntu-latest - env: - GAPIC_SHOWCASE_VERSION: 0.42.0 - OS: linux - ARCH: amd64 - steps: - - name: Checkout code - uses: actions/checkout@v7 + gapic-showcase: + name: GAPIC Showcase Conformance Tests + runs-on: ubuntu-latest + env: + GAPIC_SHOWCASE_VERSION: 0.42.0 + OS: linux + ARCH: amd64 + steps: + - name: Checkout code + uses: actions/checkout@v7 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' - - name: Get PHP Extension Directory - id: php-info - run: | - echo "ext_dir=$(php-config --extension-dir)" >> $GITHUB_OUTPUT - ini_dir=$(php --ini | grep "Scan this dir" | cut -d: -f2 | xargs) - if [ -z "$ini_dir" ]; then ini_dir="/etc/php/8.2/cli/conf.d"; fi - echo "ini_dir=$ini_dir" >> $GITHUB_OUTPUT + - name: Get PHP Extension Directory + id: php-info + run: | + echo "ext_dir=$(php-config --extension-dir)" >> $GITHUB_OUTPUT + ini_dir=$(php --ini | grep "Scan this dir" | cut -d: -f2 | xargs) + if [ -z "$ini_dir" ]; then ini_dir="/etc/php/8.2/cli/conf.d"; fi + echo "ini_dir=$ini_dir" >> $GITHUB_OUTPUT - - name: Cache gRPC Extension - id: cache-grpc - uses: actions/cache@v4 - with: - path: ~/.cache/grpc.so - key: grpc-1.83.0-php8.2-v3 + - name: Cache gRPC Extension + id: cache-grpc + uses: actions/cache@v4 + with: + path: ~/.cache/grpc.so + key: grpc-1.83.0-php8.2-v3 - - name: Install gRPC Extension - if: steps.cache-grpc.outputs.cache-hit != 'true' - run: | - sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 - mkdir -p ~/.cache - cp ${{ steps.php-info.outputs.ext_dir }}/grpc.so ~/.cache/grpc.so + - name: Install gRPC Extension + if: steps.cache-grpc.outputs.cache-hit != 'true' + run: | + sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + mkdir -p ~/.cache + cp ${{ steps.php-info.outputs.ext_dir }}/grpc.so ~/.cache/grpc.so - - name: Enable gRPC Extension - run: | - sudo cp ~/.cache/grpc.so ${{ steps.php-info.outputs.ext_dir }}/grpc.so - echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini - php -m | grep grpc + - name: Enable gRPC Extension + run: | + sudo cp ~/.cache/grpc.so ${{ steps.php-info.outputs.ext_dir }}/grpc.so + echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini + php -m | grep grpc - - name: Install and run GAPIC Showcase - run: | - curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx - ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & - sleep 2 + - name: Install and run GAPIC Showcase + run: | + curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx + ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & + sleep 2 - - name: Install dependencies - run: | - composer update --prefer-dist --no-interaction --no-suggest -d Gax/ - - - name: Run PHPUnit - run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-suggest -d Gax/ + - name: Run PHPUnit + run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist From c3639c8dea049f9c78bc236f0be85efb7ae5a19f Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Wed, 29 Jul 2026 19:41:08 +0000 Subject: [PATCH 9/9] update indenation --- .../conformance-tests-gax-showcase.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/conformance-tests-gax-showcase.yaml b/.github/workflows/conformance-tests-gax-showcase.yaml index 0e38646ef1c..09911edbbd9 100644 --- a/.github/workflows/conformance-tests-gax-showcase.yaml +++ b/.github/workflows/conformance-tests-gax-showcase.yaml @@ -41,25 +41,25 @@ jobs: - name: Install gRPC Extension if: steps.cache-grpc.outputs.cache-hit != 'true' run: | - sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 - mkdir -p ~/.cache - cp ${{ steps.php-info.outputs.ext_dir }}/grpc.so ~/.cache/grpc.so + sudo MAKEFLAGS="-j$(nproc)" pecl install grpc-1.83.0 + mkdir -p ~/.cache + cp ${{ steps.php-info.outputs.ext_dir }}/grpc.so ~/.cache/grpc.so - name: Enable gRPC Extension run: | - sudo cp ~/.cache/grpc.so ${{ steps.php-info.outputs.ext_dir }}/grpc.so - echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini - php -m | grep grpc + sudo cp ~/.cache/grpc.so ${{ steps.php-info.outputs.ext_dir }}/grpc.so + echo "extension=grpc.so" | sudo tee ${{ steps.php-info.outputs.ini_dir }}/20-grpc.ini + php -m | grep grpc - name: Install and run GAPIC Showcase run: | - curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx - ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & - sleep 2 + curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx + ./gapic-showcase run --port :7469 --tls --ca-cert-output-file Gax/tests/Conformance/showcase.pem & + sleep 2 - name: Install dependencies run: | - composer update --prefer-dist --no-interaction --no-suggest -d Gax/ + composer update --prefer-dist --no-interaction --no-suggest -d Gax/ - name: Run PHPUnit run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist