Skip to content

Commit ca20b0e

Browse files
committed
CI: in PRs only run tests for notebooks with changes
1 parent bbbd28b commit ca20b0e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ setenv =
1212
FIREFLY_URL = https://irsa.ipac.caltech.edu/irsaviewer # fallback url for firefly notebooks if not defined in code
1313
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple
1414

15-
passenv = CI, CIRCLECI
15+
passenv = CI, CIRCLECI, IS_PR
1616

1717
deps =
1818
# We use these files to specify all the dependencies, and below we override
@@ -49,8 +49,11 @@ commands =
4949
!buildhtml: bash -c 'if python -c "import platform; print(platform.platform())" | grep -i win; then cat ignore_windows_testing >> ignore_testing; fi'
5050
# ray is not yet python 3.13 compatible
5151
!buildhtml: bash -c 'if python -c "import sys; print(sys.version)" | grep 3.13; then echo Parallelize_Convolution.md >> ignore_testing; fi'
52+
5253
!buildhtml: bash -c 'if [[ $CI == true ]]; then cat ignore_gha_testing >> ignore_testing; fi'
53-
!buildhtml: bash -c 'find tutorials -name "*.md" | grep -vf ignore_testing | xargs jupytext --to notebook '
54+
55+
# We only want to run CI in PRs for the notebooks we touched
56+
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request ]]; then git diff origin/main --name-only tutorials | grep .md; else find tutorials -name "*.md"; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
5457

5558
!buildhtml: pytest --nbval-lax -vv --durations=10 tutorials
5659
buildhtml: sphinx-build -b html . _build/html -D nb_execution_mode=auto -nWT --keep-going

0 commit comments

Comments
 (0)