-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.37 KB
/
nbmake.yaml
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
46
47
48
49
50
51
52
53
54
55
# Test run all the notebooks whenever we push a branch.
name: nbmake
on:
push:
branches-ignore:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# List the notebooks
list-notebooks:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.notebook-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: notebook-matrix
run: echo "matrix=$(find notebooks -name "*.ipynb" | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
nbmake:
needs: list-notebooks
runs-on: ubuntu-latest
strategy:
matrix:
notebook: ${{ fromJson(needs.list-notebooks.outputs.matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Use poetry to install dependencies.
run: poetry install --with test
- name: Install API key
env: # Or as an environment variable
RA_API_KEY: ${{ secrets.RA_API_KEY }}
run: |
mkdir ~/.rwapi
echo "$RA_API_KEY" > ~/.rwapi/api_key.txt
- name: Test the notebook
run: |
poetry run pytest --nbmake "${{matrix.notebook}}"