Skip to content

Commit

Permalink
run notebook tests automatically if any notebooks have changed
Browse files Browse the repository at this point in the history
Signed-off-by: Peter St. John <[email protected]>
  • Loading branch information
pstjohn committed Jan 16, 2025
1 parent c868563 commit 17d2218
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,24 @@ jobs:
with:
path: ${{ github.run_id }}

- name: Check for notebook changes
id: check_notebooks
run: |
if git diff --quiet main HEAD -- '*.ipynb'; then
echo "::set-output name=changed::false"
else
echo "::set-output name=changed::true"
fi
- name: Run tests
env:
BIONEMO_DATA_SOURCE: ngc
run: ./ci/scripts/run_pytest.sh --no-nbval --skip-slow

- name: Run notebook tests
if: ${{ contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }}
if: |
${{ steps.check_notebooks.outputs.changed == 'true' ||
contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }}
env:
BIONEMO_DATA_SOURCE: ngc
run: pytest --nbval-lax -p no:python docs/ sub-packages/
Expand All @@ -146,6 +157,5 @@ jobs:
steps:
- name: clean up image
run: docker rmi nemoci.azurecr.io/bionemo:${{ github.run_id }}

# TODO: exclude tests from base image; run tests from github workspace mounted in the image.
# TODO: figure out way of cleaning up working directory (requires sudo or for us to fix file ownership from release container)

0 comments on commit 17d2218

Please sign in to comment.