This repository was archived by the owner on Mar 31, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ set -eo pipefail
2020# Enables `**` to include files nested inside sub-folders
2121shopt -s globstar
2222
23+ DIFF_FROM=" origin/main..."
24+
2325# Exit early if samples don't exist
2426if ! find samples -name ' requirements.txt' | grep -q . ; then
2527 echo " No tests run. './samples/**/requirements.txt' not found"
@@ -71,6 +73,16 @@ for file in samples/**/requirements.txt; do
7173 file=$( dirname " $file " )
7274 cd " $file "
7375
76+ # If $DIFF_FROM is set, use it to check for changes in this directory.
77+ if [[ -n " ${DIFF_FROM:- } " ]]; then
78+ git diff --quiet " $DIFF_FROM " .
79+ CHANGED=$?
80+ if [[ " $CHANGED " -eq 0 ]]; then
81+ # echo -e "\n Skipping $file: no changes in folder.\n"
82+ continue
83+ fi
84+ fi
85+
7486 echo " ------------------------------------------------------------"
7587 echo " - testing $file "
7688 echo " ------------------------------------------------------------"
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ def get_staging_dirs(
137137 ".github/workflows" , # exclude gh actions as credentials are needed for tests
138138 "README.rst" ,
139139 ".github/release-please.yml" ,
140+ ".kokoro/test-samples-impl.sh" ,
140141 ],
141142)
142143
You can’t perform that action at this time.
0 commit comments