forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger windows e2e tests when windows-related files change (open-tel…
…emetry#36857) #### Description We've noticed that many of the CI failures on main come from Windows e2e tests. We want to be more proactive in catching those failures, so this PR changes the workflow triggering Windows e2e tests to ensure they run on Pull Requests that change Windows-related files, even if the label `Run Windows` is absent. It does so by looking at changed files. If the word `windows` is present in the file name, it triggers the workflow. #### Link to tracking issue Related to open-telemetry#36788 --------- Signed-off-by: Arthur Silva Sens <[email protected]>
- Loading branch information
1 parent
32b43a2
commit 667b1cc
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# verifies if any changed file is related to windows architecture. | ||
# this script is used to determine if e2e tests should be run on windows. | ||
# | ||
# It's intended to be used in a GitHub Actions workflow: | ||
# bash .github/workflows/scripts/is_changed_file_windows.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | ||
|
||
|
||
# Get changed files | ||
base_sha=$1 | ||
head_sha=$2 | ||
changed_files=$(git diff --name-only $base_sha $head_sha) | ||
|
||
# Find windows related files | ||
windows_files=$(find * -regex ".*windows.*.go") | ||
|
||
|
||
# Loop over changed files and check if they exist in windows_files | ||
found_windows_file=false | ||
for file in $changed_files; do | ||
for windows_file in $windows_files; do | ||
if [[ $file == "$windows_file" ]]; then | ||
found_windows_file=true | ||
break | ||
fi | ||
done | ||
done | ||
|
||
echo "$found_windows_file" |