Skip to content

Commit 4f53799

Browse files
authored
Merge pull request #268 from bsipocz/CI_fix_conditions
CI: fix conditionals
2 parents 93630c9 + 219f137 commit 4f53799

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,20 @@ commands =
7575
# We only skip testing untouched tutorials in PRs; in cron and dispatch all should be tested. Make sure we don't jupytext non-notebook files.
7676
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request && -z "$(grep force_run:all_tests ${GITHUB_EVENT_PATH})" ]]; then grep -f changed_tutorials all_tutorials; else cat all_tutorials; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
7777

78-
!buildhtml: bash -c "echo 'Notebooks ignored (not tested/executed) in this job:\n'; cat ignore_testing | sort | uniq"
78+
!buildhtml: bash -c "echo 'Notebooks ignored (not tested/executed) in this job:'; cat ignore_testing | sort | uniq"
79+
7980
!buildhtml: pytest --nbval-lax -vv --suppress-no-test-exit-code --durations=10 tutorials
8081

8182
# We don't want to execute in rendering the ones we ignore for testing
82-
buildhtml: bash -c 'grep -f ignore_testing all_tutorials > ignore_execute'
83+
buildhtml: bash -c '(grep -f ignore_testing all_tutorials || true) > ignore_execute'
8384

8485
# On CircleCI rendering preview, we also don't want to execute anything that hasn't been modified
85-
buildhtml: bash -c 'if [[ $CIRCLECI == true ]]; then grep -vf changed_tutorials all_tutorials >> ignore_execute; fi'
86+
buildhtml: bash -c 'if [[ $CIRCLECI == true ]]; then (grep -vf changed_tutorials all_tutorials || true) >> ignore_execute; fi'
8687

8788
# sed -i needs a bit of hacky conditional on ubuntu to cover the case of an empty ignore
8889
buildhtml: bash -c 'if [ -s ignore_execute ]; then for name in $(cat ignore_execute | sort| uniq); do if [ -z "$(head -n 20 ${name}| grep execute:)" ]; then sed -i -e "s|kernelspec:|execute:\n skip: true\nkernelspec:|g" ${name}; fi; done;fi'
8990

90-
buildhtml: bash -c "echo 'Notebooks ignored (not tested/executed) in this job:\n'; cat ignore_execute | sort | uniq"
91+
buildhtml: bash -c "echo 'Notebooks ignored (not tested/executed) in this job:'; cat ignore_execute | sort | uniq"
9192

9293
# Using srtict so we fail with trackbacks and debug mode to have a richer log
9394
# For full build we disable parallel runs to easy server load

0 commit comments

Comments
 (0)