Skip to content

Commit fb424c9

Browse files
glasntniharika-98
authored andcommitted
chore(ci): adjust validation of test changes (terraform-google-modules#855)
* chore(ci): adjust validation of test changes borrowed from python-docs-samples https://github.com/GoogleCloudPlatform/python-docs-samples/blob/a163a4247af1ccdcb6138756e0adf75604069326/.kokoro/tests/run_tests.sh#L35 * Cloud Build wants underscores * set -e in place, rely on output rather than exit codes * python-docs-samples also wraps this in e * output helps
1 parent 1fda2b2 commit fb424c9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build/int.cloudbuild.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ steps:
3535
cat _changed_folders
3636
3737
# Do not prune if changing tests themselves
38-
while read d; do
39-
if [[ "build test .github/workflows" =~ "${d%/}" ]]; then
40-
echo "Infrastructure folder ${d%/} has changed; no tests will be pruned."
38+
set +e
39+
_build_changes=$(git diff origin/main build test .github/workflows)
40+
set -e
41+
if [[ -n "${_build_changes}" ]]; then
42+
echo "Infrastructure folders have changed; no tests will be pruned."
4143
exit 0 # do not prune
42-
fi
43-
done < _changed_folders
44+
fi
4445
4546
# Remove base folders without changes
4647
for d in *; do

0 commit comments

Comments
 (0)