-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow that tests the notebooks. (#3)
- Loading branch information
Showing
4 changed files
with
280 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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}}" |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.