summaryrefslogtreecommitdiffstats
path: root/tests/drone-run-integration-tests.sh
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-08-27 11:31:15 +0200
committerJoas Schilling <coding@schilljs.com>2019-08-27 11:31:15 +0200
commit23a0cbe6efe55b65dfc12e7b9f1e1966ec3cd40f (patch)
tree85585d230bea58d65f6a0b257ed31c0a328f0668 /tests/drone-run-integration-tests.sh
parent6df6fc562404f885bd02e125391620d4153c8f95 (diff)
downloadnextcloud-server-23a0cbe6efe55b65dfc12e7b9f1e1966ec3cd40f.tar.gz
nextcloud-server-23a0cbe6efe55b65dfc12e7b9f1e1966ec3cd40f.zip
Only run integration tests when PHP was modified
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/drone-run-integration-tests.sh')
-rwxr-xr-xtests/drone-run-integration-tests.sh15
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