@@ -216,9 +216,9 @@ jobs:
216216 run : |
217217 pushd cuda_python/docs/
218218 if [[ "${{ inputs.is-release }}" == "false" ]]; then
219- DOCS_LINKCHECK=1 ./build_all_docs.sh latest-only
219+ ./build_all_docs.sh latest-only
220220 else
221- DOCS_LINKCHECK=1 ./build_all_docs.sh
221+ ./build_all_docs.sh
222222 # At release time, we don't want to update the latest docs
223223 rm -rf build/html/latest
224224 fi
@@ -232,9 +232,9 @@ jobs:
232232 COMPONENT=$(echo "${{ inputs.component }}" | tr '-' '_')
233233 pushd ${COMPONENT}/docs/
234234 if [[ "${{ inputs.is-release }}" == "false" ]]; then
235- DOCS_LINKCHECK=1 ./build_docs.sh latest-only
235+ ./build_docs.sh latest-only
236236 else
237- DOCS_LINKCHECK=1 ./build_docs.sh
237+ ./build_docs.sh
238238 # At release time, we don't want to update the latest docs
239239 rm -rf build/html/latest
240240 fi
@@ -248,6 +248,11 @@ jobs:
248248 fi
249249 mv ${COMPONENT}/docs/build/html/* artifacts/docs/${TARGET}
250250
251+ - name : Write doc preview marker
252+ if : ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
253+ run : |
254+ echo "${{ github.sha }}" > artifacts/docs/.preview-commit
255+
251256 # TODO: Consider removing this step?
252257 - name : Upload doc artifacts
253258 uses : actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
@@ -263,6 +268,69 @@ jobs:
263268 ' artifacts/empty_docs' }}
264269 pr-number : ${{ env.PR_NUMBER }}
265270
271+ - name : Wait for doc preview deployment
272+ if : ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
273+ env :
274+ PREVIEW_URL : https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
275+ run : |
276+ marker_url="${PREVIEW_URL}/.preview-commit"
277+ for attempt in {1..60}; do
278+ marker=$(curl -fsSL "${marker_url}" || true)
279+ if [[ "${marker}" == "${{ github.sha }}" ]]; then
280+ echo "Doc preview is available at ${PREVIEW_URL}"
281+ exit 0
282+ fi
283+ echo "Waiting for doc preview marker ${marker_url} (${attempt}/60)"
284+ sleep 10
285+ done
286+ echo "error: doc preview marker did not update to ${{ github.sha }}" >&2
287+ exit 1
288+
289+ - name : Restore lychee cache
290+ id : restore-lychee-cache
291+ if : ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
292+ uses : actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
293+ with :
294+ path : .lycheecache
295+ key : docs-preview-lychee-${{ env.PR_NUMBER }}-${{ github.sha }}
296+ restore-keys : |
297+ docs-preview-lychee-${{ env.PR_NUMBER }}-
298+
299+ - name : Check doc preview links
300+ if : ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
301+ uses : lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
302+ with :
303+ args : >-
304+ --base-url https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}/
305+ --root-dir ${{ github.workspace }}/artifacts/docs
306+ --index-files index.html
307+ --fallback-extensions html,htm
308+ --include-fragments full
309+ --cache
310+ --max-cache-age 1d
311+ --max-concurrency 16
312+ --host-concurrency 2
313+ --host-request-interval 250ms
314+ --max-retries 3
315+ --retry-wait-time 5
316+ --timeout 30
317+ --no-progress
318+ '${{ github.workspace }}/artifacts/docs/**/*.html'
319+ fail : true
320+ failIfEmpty : true
321+ format : markdown
322+ jobSummary : true
323+ lycheeVersion : v0.24.2
324+ output : lychee-preview.md
325+ token : ${{ github.token }}
326+
327+ - name : Save lychee cache
328+ if : ${{ always() && !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') && steps.restore-lychee-cache.outputs.cache-hit != 'true' && steps.restore-lychee-cache.outputs.cache-primary-key != '' }}
329+ uses : actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
330+ with :
331+ path : .lycheecache
332+ key : ${{ steps.restore-lychee-cache.outputs.cache-primary-key }}
333+
266334 - name : Deploy doc update
267335 if : ${{ github.ref_name == 'main' || inputs.is-release }}
268336 uses : JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
0 commit comments