-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run BK exhaustive pipeline when code is pushed (#15738)
This commit enables running the exhaustive tests Buildkite pipeline (i.e. the equivalent to the `main` Jenkins tests) ; the trigger is code events, i.e. direct pushes, merge commits and creation of new branches. CI is skipped if changes are only related to files under `docs/`. (cherry picked from commit c8726b7)
- Loading branch information
1 parent
dccb2ce
commit 42c8135
Showing
3 changed files
with
45 additions
and
5 deletions.
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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ********************************************************** | ||
# Returns true if current checkout compared to parent commit | ||
# has changes ONLY matching the argument regexp | ||
# | ||
# Used primarily to skip running the exhaustive pipeline | ||
# when only docs changes have happened. | ||
# ******************************************************** | ||
|
||
if [[ -z "$1" ]]; then | ||
echo "Usage: $0 <regexp>" | ||
exit 1 | ||
fi | ||
|
||
previous_commit=$(git rev-parse HEAD^) | ||
changed_files=$(git diff --name-only $previous_commit) | ||
|
||
if [[ -n "$changed_files" ]] && [[ -z "$(echo "$changed_files" | grep -vE "$1")" ]]; then | ||
echo "All files compared to the previous commit [$previous_commit] match the specified regex: [$1]" | ||
echo "Files changed:" | ||
git diff --name-only HEAD^ | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
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