Skip to content

Commit 2a22f81

Browse files
committed
Check deployed docs preview links
1 parent ff3ba3d commit 2a22f81

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,26 @@ jobs:
301301
restore-keys: |
302302
docs-preview-lychee-${{ env.PR_NUMBER }}-
303303
304+
- name: Write lychee doc preview URL list
305+
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
306+
env:
307+
PREVIEW_URL: https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
308+
run: |
309+
find "${GITHUB_WORKSPACE}/artifacts/docs" -type f -name '*.html' -printf '%P\n' \
310+
| LC_ALL=C sort \
311+
| sed "s#^#${PREVIEW_URL}/#" > lychee-preview-urls.txt
312+
if [[ ! -s lychee-preview-urls.txt ]]; then
313+
echo "error: no rendered HTML pages found for lychee" >&2
314+
exit 1
315+
fi
316+
wc -l lychee-preview-urls.txt
317+
304318
- name: Check doc preview links
305319
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
306320
uses: lycheeverse/lychee-action@6da1d14f3a43098a294b7696d93d938aa8d20fc0 # unreleased: supports v0.24.x archive layout
307321
with:
308322
args: >-
309-
--base-url https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}/
310-
--root-dir ${{ github.workspace }}/artifacts/docs
311-
--index-files index.html
312-
--fallback-extensions html,htm
323+
--files-from ${{ github.workspace }}/lychee-preview-urls.txt
313324
--include-fragments=full
314325
--cache
315326
--max-cache-age 1d
@@ -320,11 +331,10 @@ jobs:
320331
--retry-wait-time 5
321332
--timeout 30
322333
--no-progress
323-
'${{ github.workspace }}/artifacts/docs/**/*.html'
324334
fail: true
325335
failIfEmpty: true
326336
format: markdown
327-
jobSummary: true
337+
jobSummary: false
328338
lycheeVersion: v0.24.2
329339
output: lychee-preview.md
330340
token: ${{ github.token }}

0 commit comments

Comments
 (0)