Skip to content

Commit 47fb909

Browse files
rossbarMridulS
andauthored
DEV: Add nbval to CI. (#132)
Co-authored-by: Mridul Seth <[email protected]>
1 parent 2f1ed0e commit 47fb909

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Diff for: .github/workflows/notebooks.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test notebooks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
max-parallel: 12
16+
matrix:
17+
os: [Ubuntu-20.04, macOS-latest]
18+
python-version: [3.8, 3.9, "3.10"]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install -r site/requirements.txt -r requirements.txt
30+
python -m pip list
31+
32+
- name: Test with nbval
33+
run: |
34+
python -m pip install pytest nbval
35+
find content/ -name "*.md" -exec jupytext --to notebook {} \;
36+
# TODO: find better way to exclude notebooks from test
37+
rm content/tutorial-deep-reinforcement-learning-with-pong-from-pixels.ipynb
38+
rm content/pairing.ipynb
39+
rm content/tutorial-style-guide.ipynb
40+
rm content/tutorial-nlp-from-scratch.ipynb
41+
# Test notebook execution
42+
pytest --nbval-lax --durations=10 content/

0 commit comments

Comments
 (0)