diff options
author | Joas Schilling <coding@schilljs.com> | 2019-08-27 12:31:15 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-08-28 12:05:15 +0300 |
commit | 4d5e74007a598d2710fed0f1469dac2596122c19 (patch) | |
tree | 5b31cbf12a81451dc64195f24d2ddced3e312642 /tests | |
parent | e7039cc2f5ad62e4245305179f093f02550d90a6 (diff) |
Only run integration tests when PHP was modified
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/drone-run-integration-tests.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/drone-run-integration-tests.sh b/tests/drone-run-integration-tests.sh new file mode 100755 index 00000000000..9da224ccbad --- /dev/null +++ b/tests/drone-run-integration-tests.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "=========================" +echo "= List of changed files =" +echo "=========================" +git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA +echo "=========================" + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | wc -l) -eq 0 ]] && echo "No files are modified => merge commit" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "^build/integration/") -gt 0 ]] && echo "Integration test files are modified" && exit 0 + +exit 1 |