summaryrefslogtreecommitdiffstats
path: root/tests/drone-run-php-tests.sh
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-16 10:20:48 +0200
committerJoas Schilling <coding@schilljs.com>2019-07-16 10:20:48 +0200
commit2a942d6ab05e10a75b3602abd17b3a84fd812266 (patch)
tree97cf8e27d80f784a8759f0e21bfb43a7aeac489d /tests/drone-run-php-tests.sh
parent54e8ebe40c0d1fb250ac6bfa8c748a1671c3bed4 (diff)
Only run php, integration and acceptance tests when required
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/drone-run-php-tests.sh')
-rwxr-xr-xtests/drone-run-php-tests.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/drone-run-php-tests.sh b/tests/drone-run-php-tests.sh
new file mode 100755
index 000000000..5d328f49e
--- /dev/null
+++ b/tests/drone-run-php-tests.sh
@@ -0,0 +1,13 @@
+#!/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 | 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 "^tests/php/") -gt 0 ]] && echo "PHP test files are modified" && exit 0
+
+exit 1