-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from carpentries-incubator/PostTransitionFixes
ENH: Post Workbench transition fixes
- Loading branch information
Showing
2 changed files
with
57 additions
and
6 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,51 @@ | ||
name: Test notebooks | ||
|
||
on: | ||
push: | ||
paths: ["*.ipynb", "requirements.txt", "notebook.yml"] | ||
|
||
jobs: | ||
test-notebooks: | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- name: Checkout GitHub repository | ||
uses: actions/checkout@v4 | ||
|
||
# Run with multiple Python versions. | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Use a cache for the pip install to avoid reinstalling every time this is run. | ||
- name: Cache pip install | ||
uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ env.pythonLocation }}- | ||
# Install all requirements to run these tests. | ||
- name: Install requirements | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest nbval | ||
# Download the necessary data | ||
- name: Download data | ||
run: | | ||
datalad install | ||
# Run the actual tests of all the Python Notebooks. | ||
- name: Test Notebooks | ||
run: | | ||
pytest --nbval-lax -v code/*ipynb |
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