-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if sub-directories have changes (#16940)
* Check if sub-directories have changes On travis check if the projects directory and dependencies have any changes. If not we finish early. Limitation: This still requires travis to setup a VM. We just terminate the VM early when the test detects that the system under test or it's dependencies have no changes. - do not run unit/integration/system tests if asciidoc files have been modified only
- Loading branch information
Steffen Siering
authored
Mar 11, 2020
1 parent
30e432e
commit 99ded8e
Showing
2 changed files
with
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
# commit range to check for. For example master...<PR branch> | ||
RANGE=$TRAVIS_COMMIT_RANGE | ||
DIRLIST=$@ | ||
|
||
# find modified files in range and filter out docs only changes | ||
CHANGED_FILES=$(git diff --name-only $RANGE | grep -v '.asciidoc') | ||
|
||
beginswith() { case $2 in "$1"*) true;; *) false;; esac } | ||
|
||
for path in $DIRLIST; do | ||
for changed in $CHANGED_FILES; do | ||
if beginswith $path $changed; then | ||
exit 0 # found a match -> continue testing | ||
fi | ||
done | ||
done | ||
|
||
echo "NOT testing required. Modified files: $CHANGED_FILES" | ||
exit 1 |
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