Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .kokoro/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,24 @@ for path in `find 'packages' \
package_path="packages/${package_name}"

# Determine if we should skip based on git diff
files_to_check="${package_path}/CHANGELOG.md"
# We always check for changes in these specific versioning/config files
files_to_check=(
"${package_path}/CHANGELOG.md"
"${package_path}/setup.py"
"${package_path}/pyproject.toml"
"${package_path}/**/gapic_version.py"
"${package_path}/**/version.py"
)

# If the package is in our "always run full system tests" list, check the whole directory
if [[ $package_name == @($packages_with_system_tests_pattern) ]]; then
files_to_check="${package_path}"
files_to_check=("${package_path}")
fi

echo "checking changes with 'git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- ${files_to_check}'"
echo "checking changes with 'git diff ${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT} -- ${files_to_check[*]}'"
set +e
package_modified=$(git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- ${files_to_check} | wc -l)
# Passing the array expanded as arguments to git diff
package_modified=$(git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- "${files_to_check[@]}" | wc -l)
Comment thread
parthea marked this conversation as resolved.
set -e

if [[ "${package_modified}" -gt 0 || "$KOKORO_BUILD_ARTIFACTS_SUBDIR" == *"continuous"* ]]; then
Expand Down
Loading