Skip to content

Commit 242e2cb

Browse files
authored
feat(docs): use doctum shared workflow for reference docs (#2618)
1 parent b1f63d7 commit 242e2cb

File tree

6 files changed

+27
-79
lines changed

6 files changed

+27
-79
lines changed

.github/actions/docs/entrypoint.sh

-21
This file was deleted.

.github/actions/docs/sami.php

-29
This file was deleted.

.github/workflows/docs.yml

+20-25
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
name: Generate Documentation
22
on:
33
push:
4-
branches: [main]
4+
tags:
5+
- "*"
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag to generate documentation for'
10+
required: false
11+
pull_request:
12+
13+
permissions:
14+
contents: write
515

616
jobs:
717
docs:
8-
name: "Generate Project Documentation"
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v2
13-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
14-
- name: Install Dependencies
15-
uses: nick-invision/retry@v1
16-
with:
17-
timeout_minutes: 10
18-
max_attempts: 3
19-
command: composer install
20-
- name: Generate and Push Documentation
21-
uses: docker://php:8.1-cli
22-
env:
23-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24-
with:
25-
entrypoint: ./.github/actions/docs/entrypoint.sh
26-
- name: Deploy 🚀
27-
uses: JamesIves/github-pages-deploy-action@releases/v3
28-
with:
29-
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
30-
BRANCH: gh-pages
31-
FOLDER: .docs
18+
name: "Generate and Deploy Documentation"
19+
uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@main
20+
with:
21+
title: "Google Cloud PHP Client"
22+
default_version: ${{ inputs.tag || github.ref_name }}
23+
exclude_file: aliases.php
24+
tag_pattern: "v2.*"
25+
dry_run: ${{ github.event_name == 'pull_request' }}
26+

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ list of [Google cloud packages](https://cloud.google.com/php/docs/reference) fir
77
these are the recommended libraries.
88

99
<dl>
10-
<dt>Reference Docs</dt><dd><a href="https://googleapis.github.io/google-api-php-client/main/">https://googleapis.github.io/google-api-php-client/main/</a></dd>
10+
<dt>Reference Docs</dt><dd><a href="https://googleapis.github.io/google-api-php-client/">https://googleapis.github.io/google-api-php-client/</a></dd>
1111
<dt>License</dt><dd>Apache 2.0</dd>
1212
</dl>
1313

src/Client.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,8 @@ public function setAuthConfig($config)
10431043

10441044
$key = isset($config['installed']) ? 'installed' : 'web';
10451045
if (isset($config['type']) && $config['type'] == 'service_account') {
1046-
// application default credentials
1046+
// @TODO(v3): Remove this, as it isn't accurate. ADC applies only to determining
1047+
// credentials based on the user's environment.
10471048
$this->useApplicationDefaultCredentials();
10481049

10491050
// set the information from the config

tests/Google/ClientTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,10 @@ public function testOnGceCacheAndCacheOptions()
714714
$mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY)
715715
->shouldBeCalledTimes(1)
716716
->willReturn($mockCacheItem->reveal());
717-
$mockCache->getItem(GCECredentials::cacheKey . 'universe_domain')
718-
->shouldBeCalledTimes(1)
717+
// cache key from GCECredentials::getTokenUri() . 'universe_domain'
718+
$mockCache->getItem('cc685e3a0717258b6a4cefcb020e96de6bcf904e76fd9fc1647669f42deff9bf') // google/auth < 1.41.0
719+
->willReturn($mockUniverseDomainCacheItem->reveal());
720+
$mockCache->getItem(GCECredentials::cacheKey . 'universe_domain') // google/auth >= 1.41.0
719721
->willReturn($mockUniverseDomainCacheItem->reveal());
720722

721723
$client = new Client(['cache_config' => $cacheConfig]);

0 commit comments

Comments
 (0)