File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,25 @@ notebook_files=()
7
7
all_markdown_files=$( find tutorials -type f -name " *.md" )
8
8
9
9
if [ $# -gt 0 ]; then
10
- if [[ " $1 " == all ]]; then
11
- files_to_process=$all_markdown_files
10
+ echo " INFO: Testing only a subset of notebooks"
11
+ if [[ " $1 " == --changed ]]; then
12
+ # We only want to run tests for the notebooks we touched compared to `branch`
13
+ # provided in the second argument.
14
+ branch=$2
15
+ files_to_process=$( git fetch ${branch} --depth=1; git diff ${branch} --name-only tutorials | grep .md)
16
+
12
17
else
13
18
files_to_process=" $@ "
14
19
fi
15
20
16
21
else
17
- # We only want to run tests for the notebooks we touched
18
- files_to_process=$( git fetch origin main --depth=1; git diff origin/main --name-only tutorials | grep .md)
22
+ echo " INFO: Testing all the notebooks"
23
+ files_to_process=$all_markdown_files
24
+
19
25
fi
20
26
21
27
# Identify Markdown files that are Jupytext and convert them all.
22
28
for file in ${files_to_process} ; do
23
- echo loop in $file
24
29
# Extract the kernel information from the Jupytext Markdown file.
25
30
kernel_info=$( grep -A 10 ' ^---$' " $file " | grep -E ' kernelspec' )
26
31
# Skip if no kernel information was found.
You can’t perform that action at this time.
0 commit comments