-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test notebooks with a separate CI workflow #151
Changes from all commits
25dcbcd
dd0fbc2
0925015
1443ea7
4dc97cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test Notebooks | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
test-notebooks: | ||
|
||
if: | ||
github.event_name == 'push' || | ||
github.event.pull_request.head.repo.full_name != github.repository | ||
|
||
name: Test the notebooks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
python-version: "3.11" | ||
miniforge-variant: Miniforge3 | ||
miniforge-version: latest | ||
auto-update-conda: true | ||
|
||
- name: Install nox | ||
run: pip install nox | ||
|
||
- name: Test | ||
env: | ||
MPLBACKEND: "Agg" | ||
OPENTOPOGRAPHY_API_KEY: ${{ secrets.OPENTOPOGRAPHY_API_KEY }} | ||
run: nox -s test-notebooks --python "3.11" |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the old way of reading an ESRI ASCII file. We should update this notebook to use the new way. But in another pull request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, OK. I couldn't remember which was the new way. I only changed it because it was failing in the CI test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a future pr, the new way is something like, from landlab.io import esri_ascii
with open("data/square-test-basin.asc") as stream:
grid = esri_ascii.load(filepath, name="topographic__elevation")
z = grid.at_node["topographic__elevation"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you decide to run this job as a separate workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like separating unit tests from checking notebooks. They feel like different things, even though we call both "tests" and they run through pytest. Also
test.yml
was longer than one screen.Is there a penalty for splitting jobs across workflows instead of grouping them into one workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a subject for discussion on the Forum!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the workflows are independent of one another, it's fine separating them. If you had a third job (e.g. maybe building/deploying docs or deploying to PyPI) that required both the regular tests and the notebook tests to complete, then you would have to put them in a single workflow.