Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -24,6 +21,7 @@ env:
NOX_ENVDIR: "/tmp/shared_nox_envs"
NOX_DEFAULT_VENV_BACKEND: "uv"
UV_VENV_SEED: "1"
UV_CONCURRENT_BUILDS: "1"
# Run checks in parallel using 4 cores
PARALLEL_WORKERS: "4"

Expand All @@ -41,7 +39,7 @@ jobs:
PACKAGE_WEIGHTS: |
google-ads-admanager: 9
google-cloud-compute: 50
google-cloud-compute-v1beta: 100
google-cloud-compute-v1beta: 120
google-cloud-dialogflow: 9
google-cloud-dialogflow-cx: 9
google-cloud-discoveryengine: 15
Expand Down Expand Up @@ -136,9 +134,15 @@ jobs:
fi
echo "All docs shards passed or were skipped!"

docfx:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
docfx-shard:
needs: initialize
if: needs.initialize.outputs.matrix != '[]' && needs.initialize.outputs.matrix != ''
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
package_shard: ${{ fromJson(needs.initialize.outputs.matrix) }}
name: ${{ matrix.package_shard.is_sharded && format('docfx ({0})', matrix.package_shard.name) || format('docfx ({0})', matrix.package_shard.description) }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Expand All @@ -156,12 +160,31 @@ jobs:
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox uv
- name: Run docfx
- name: Run docfx for ${{ matrix.package_shard.description }}
env:
BUILD_TYPE: presubmit
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref_name }}
TEST_TYPE: docfx
PACKAGE_LIST: ${{ matrix.package_shard.packages }}
# TODO(https://github.com/googleapis/google-cloud-python/issues/13775): Specify `PY_VERSION` rather than relying on the default python version of the nox session.
PY_VERSION: "unused"
run: |
ci/run_conditional_tests.sh

docfx:
if: always()
needs: [initialize, docfx-shard]
runs-on: ubuntu-latest
name: docfx
steps:
- name: Check docfx job status
run: |
if [[ "${{ needs.initialize.result }}" != "success" ]]; then
echo "Error: The initialize job status was: ${{ needs.initialize.result }}"
exit 1
fi
if [[ "${{ needs['docfx-shard'].result }}" != "success" && "${{ needs['docfx-shard'].result }}" != "skipped" ]]; then
echo "docfx failed with result: ${{ needs['docfx-shard'].result }}"
exit 1
fi
echo "All docfx shards passed or were skipped!"
Loading