Skip to content

Commit 3c4b9b9

Browse files
authored
CI_check_correctness_notebooks (#49935)
* CI_check_correctness_notebooks * add run code_checks.sh notebooks in CI
1 parent 56f3aaa commit 3c4b9b9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/code-checks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
run: ci/code_checks.sh docstrings
8080
if: ${{ steps.build.outcome == 'success' && always() }}
8181

82+
- name: Run check of documentation notebooks
83+
run: ci/code_checks.sh notebooks
84+
if: ${{ steps.build.outcome == 'success' && always() }}
85+
8286
- name: Use existing environment for type checking
8387
run: |
8488
echo $PATH >> $GITHUB_PATH

ci/code_checks.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# $ ./ci/code_checks.sh doctests # run doctests
1313
# $ ./ci/code_checks.sh docstrings # validate docstring errors
1414
# $ ./ci/code_checks.sh single-docs # check single-page docs build warning-free
15+
# $ ./ci/code_checks.sh notebooks # check execution of documentation notebooks
1516

16-
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" ]] || \
17-
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings]"; exit 9999; }
17+
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \
18+
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }
1819

1920
BASE_DIR="$(dirname $0)/.."
2021
RET=0
@@ -84,6 +85,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8485

8586
fi
8687

88+
### DOCUMENTATION NOTEBOOKS ###
89+
if [[ -z "$CHECK" || "$CHECK" == "notebooks" ]]; then
90+
91+
MSG='Notebooks' ; echo $MSG
92+
jupyter nbconvert --execute $(find doc/source -name '*.ipynb') --to notebook
93+
RET=$(($RET + $?)) ; echo $MSG "DONE"
94+
95+
fi
96+
8797
### SINGLE-PAGE DOCS ###
8898
if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then
8999
python doc/make.py --warnings-are-errors --single pandas.Series.value_counts

0 commit comments

Comments
 (0)