Skip to content

Test librarian with new wrkflw #2

Test librarian with new wrkflw

Test librarian with new wrkflw #2

Workflow file for this run

name: CI Docs
on:
pull_request:
branches: [ main, preview ]
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ==========================================
# 1. DISCOVERY & BUCKETING
# ==========================================
discover:
runs-on: ubuntu-latest
outputs:
buckets: ${{ steps.generate-matrix.outputs.buckets }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Detect Changed Packages
id: changes
uses: tj-actions/changed-files@v44
with:
files: packages/**
dir_names: true
dir_names_max_depth: 2
matrix: false
- name: Generate Balanced Buckets
id: generate-matrix
env:
CHANGED_DIRS: ${{ steps.changes.outputs.all_changed_files }}
run: python .github/scripts/matrix_generator.py --matrix-multiplier 2 --max-vms 10
# ==========================================
# 2. DOCS (Py 3.10)
# ==========================================
docs:
needs: discover
if: ${{ needs.discover.outputs.buckets != '[]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 60
matrix:
chunk: ${{ fromJSON(needs.discover.outputs.buckets) }}
name: docs (Py 3.10 - ${{ matrix.chunk.id }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
enable-cache: true
- name: Execute Chunk
run: |
export NOX_DEFAULT_VENV_BACKEND=uv
export UV_VENV_SEED=1
export UV_COMPILE_BYTECODE=1
FAILED=0
for pkg in ${{ matrix.chunk.packages }}; do
echo "=========================================================="
echo "🚀 TESTING DOCS: $pkg"
echo "=========================================================="
cd "$pkg"
if uvx --with 'nox[uv]' nox -l | grep -q "\bdocs\b"; then
uvx --with 'nox[uv]' nox -s "docs" || FAILED=1
else
echo "⏭️ Session 'docs' not defined for $pkg. Safely skipping."
fi
cd "$GITHUB_WORKSPACE"
done
exit $FAILED
# ==========================================
# 3. DOCFX (Py 3.10)
# ==========================================
docfx:
needs: discover
if: ${{ needs.discover.outputs.buckets != '[]' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 60
matrix:
chunk: ${{ fromJSON(needs.discover.outputs.buckets) }}
name: docfx (Py 3.10 - ${{ matrix.chunk.id }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
enable-cache: true
- name: Execute Chunk
run: |
export NOX_DEFAULT_VENV_BACKEND=uv
export UV_VENV_SEED=1
export UV_COMPILE_BYTECODE=1
FAILED=0
for pkg in ${{ matrix.chunk.packages }}; do
echo "=========================================================="
echo "🚀 TESTING DOCFX: $pkg"
echo "=========================================================="
cd "$pkg"
if uvx --with 'nox[uv]' nox -l | grep -q "\bdocfx\b"; then
uvx --with 'nox[uv]' nox -s "docfx" || FAILED=1
else
echo "⏭️ Session 'docfx' not defined for $pkg. Safely skipping."
fi
cd "$GITHUB_WORKSPACE"
done
exit $FAILED
# ==========================================
# 4. GATEKEEPER
# ==========================================
presubmit-passed:
if: always()
needs: [discover, docs, docfx]
runs-on: ubuntu-latest
steps:
- name: Evaluate Pipeline Status
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "::error::One or more required CI jobs failed or were cancelled."
exit 1
fi
echo "All dynamically generated CI jobs completed successfully."