-
Notifications
You must be signed in to change notification settings - Fork 16
45 lines (40 loc) · 1.43 KB
/
jupyter-matrix.yml
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
42
43
44
45
name: jupyter-matrix
on: push
jobs:
list-notebooks:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(ls tutorials/**/*.ipynb | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
notebook:
needs: list-notebooks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
manifest: ${{ fromJson(needs.list-notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup ffmpeg (with retries)
uses: ./.github/actions/setup-ffmpeg
- name: Setup TeX Live
uses: teatimeguest/setup-texlive-action@v3
with:
packages: scheme-full
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install -r requirements_dev.txt
- name: Build notebook
run: |
jupyter nbconvert --to notebook --inplace --execute --allow-errors "${{ matrix.manifest }}"
TOTAL_ERRORS=0
grep -q '"output_type": "error"' "${{ matrix.manifest }}" && echo "Found errors in ${{ matrix.manifest }}" && TOTAL_ERRORS=1 && printf '%b\n' | jq -r '.cells[].outputs[]?.traceback[]?' "${{ matrix.manifest }}"
exit $TOTAL_ERRORS