-
Notifications
You must be signed in to change notification settings - Fork 1.7k
148 lines (129 loc) · 4.42 KB
/
Copy pathci-docs.yml
File metadata and controls
148 lines (129 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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."