Skip to content

Commit

Permalink
feat(docs): use doctum shared workflow for reference docs (#2618)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Aug 26, 2024
1 parent b1f63d7 commit 242e2cb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 79 deletions.
21 changes: 0 additions & 21 deletions .github/actions/docs/entrypoint.sh

This file was deleted.

29 changes: 0 additions & 29 deletions .github/actions/docs/sami.php

This file was deleted.

45 changes: 20 additions & 25 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
name: Generate Documentation
on:
push:
branches: [main]
tags:
- "*"
workflow_dispatch:
inputs:
tag:
description: 'Tag to generate documentation for'
required: false
pull_request:

permissions:
contents: write

jobs:
docs:
name: "Generate Project Documentation"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
command: composer install
- name: Generate and Push Documentation
uses: docker://php:8.1-cli
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
entrypoint: ./.github/actions/docs/entrypoint.sh
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: .docs
name: "Generate and Deploy Documentation"
uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@main
with:
title: "Google Cloud PHP Client"
default_version: ${{ inputs.tag || github.ref_name }}
exclude_file: aliases.php
tag_pattern: "v2.*"
dry_run: ${{ github.event_name == 'pull_request' }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ list of [Google cloud packages](https://cloud.google.com/php/docs/reference) fir
these are the recommended libraries.

<dl>
<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>
<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>
<dt>License</dt><dd>Apache 2.0</dd>
</dl>

Expand Down
3 changes: 2 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,8 @@ public function setAuthConfig($config)

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

// set the information from the config
Expand Down
6 changes: 4 additions & 2 deletions tests/Google/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,10 @@ public function testOnGceCacheAndCacheOptions()
$mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY)
->shouldBeCalledTimes(1)
->willReturn($mockCacheItem->reveal());
$mockCache->getItem(GCECredentials::cacheKey . 'universe_domain')
->shouldBeCalledTimes(1)
// cache key from GCECredentials::getTokenUri() . 'universe_domain'
$mockCache->getItem('cc685e3a0717258b6a4cefcb020e96de6bcf904e76fd9fc1647669f42deff9bf') // google/auth < 1.41.0
->willReturn($mockUniverseDomainCacheItem->reveal());
$mockCache->getItem(GCECredentials::cacheKey . 'universe_domain') // google/auth >= 1.41.0
->willReturn($mockUniverseDomainCacheItem->reveal());

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

0 comments on commit 242e2cb

Please sign in to comment.