-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1.12 KB
/
validate_notebooks.yml
File metadata and controls
41 lines (35 loc) · 1.12 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
name: Validate Notebooks
on:
push:
paths:
- '**.ipynb'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Required to fetch the history for 'tj-actions/changed-files'
fetch-depth: 0
- name: Get changed notebooks
id: changed-notebooks
uses: tj-actions/changed-files@v44
with:
files: |
**.ipynb
- name: Setup Python and Dependencies
if: steps.changed-notebooks.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
if: steps.changed-notebooks.outputs.any_changed == 'true'
run: pip install -r requirements.txt
- name: Run changed notebooks
if: steps.changed-notebooks.outputs.any_changed == 'true'
run: |
for notebook in ${{ steps.changed-notebooks.outputs.all_changed_files }}; do
echo "--- Validating ${notebook} ---"
jupyter nbconvert --to script --execute "${notebook}"
done