Skip to content
Open
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
30 changes: 24 additions & 6 deletions .github/workflows/test-all-notebooks-weekly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test all notebooks (weekly)
name: Test all notebooks (weekly + on-demand)

on:
schedule:
Expand All @@ -7,9 +7,21 @@ on:
workflow_dispatch:
inputs:
filter:
description: 'Optional substring filter on notebook paths (regex)'
description: 'Regex on notebook paths (leave blank for all). Example: tutorials/.*'
required: false
default: ''
single_notebook:
description: 'Run a single notebook (full path). Overrides filter if set.'
required: false
default: ''
file_issue:
description: 'File/update the weekly-notebook-sweep tracking issue on failure'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'

permissions:
contents: read
Expand All @@ -32,15 +44,21 @@ jobs:
id: list
run: |
set -euo pipefail
all=$(python .github/scripts/list_notebooks.py)
single='${{ github.event.inputs.single_notebook }}'
filter='${{ github.event.inputs.filter }}'
if [ -n "$filter" ]; then
all=$(echo "$all" | python -c "
if [ -n "$single" ]; then
all=$(python -c "import json; print(json.dumps(['$single']))")
echo "Manual single-notebook run: $single"
else
all=$(python .github/scripts/list_notebooks.py)
if [ -n "$filter" ]; then
all=$(echo "$all" | python -c "
import json, re, sys
pat = re.compile(r'''$filter''')
nbs = json.load(sys.stdin)
print(json.dumps([n for n in nbs if pat.search(n)]))
")
fi
fi
echo "notebooks=$all" >> "$GITHUB_OUTPUT"
count=$(echo "$all" | python -c "import json,sys;print(len(json.load(sys.stdin)))")
Expand Down Expand Up @@ -161,7 +179,7 @@ jobs:
EOF

- name: File or update tracking issue if any failures
if: steps.report.outputs.failed_count != '0'
if: steps.report.outputs.failed_count != '0' && github.event.inputs.file_issue != 'false'
uses: actions/github-script@v7
with:
script: |
Expand Down
Loading