diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-10-30 13:06:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 13:06:50 +0100 |
commit | f94af85749f1c98564c7b4f503a13309a24595fb (patch) | |
tree | e31130528af990248425699d633b03db5366f5f3 /tests | |
parent | 9b54a4adeaad9900e3ed90ef19396f8467000051 (diff) | |
parent | 8a3d9e52e3fc2200e04cd57ec3ea2d5ce713cb8a (diff) | |
download | nextcloud-server-f94af85749f1c98564c7b4f503a13309a24595fb.tar.gz nextcloud-server-f94af85749f1c98564c7b4f503a13309a24595fb.zip |
Merge pull request #23788 from nextcloud/techdebt/noid/only-run-phpunit-when-php-changed
Only run phpunit when "php" changed
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/drone-run-integration-tests.sh | 8 | ||||
-rwxr-xr-x | tests/drone-run-php-tests.sh | 25 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/drone-run-integration-tests.sh b/tests/drone-run-integration-tests.sh index 9da224ccbad..af3c7a895c8 100755 --- a/tests/drone-run-integration-tests.sh +++ b/tests/drone-run-integration-tests.sh @@ -8,6 +8,14 @@ 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 ".json" | grep -v "package.json" | grep -c -v "package-lock.json") -gt 0 ]] && echo "JSON files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".sh") -gt 0 ]] && echo "bash files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".yml") -gt 0 ]] && echo "YML files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".xml") -gt 0 ]] && echo "info.xml files are modified" && 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 diff --git a/tests/drone-run-php-tests.sh b/tests/drone-run-php-tests.sh new file mode 100755 index 00000000000..c51117a21d2 --- /dev/null +++ b/tests/drone-run-php-tests.sh @@ -0,0 +1,25 @@ +#!/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 ".json" | grep -v "package.json" | grep -c -v "package-lock.json") -gt 0 ]] && echo "JSON files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".sh") -gt 0 ]] && echo "bash files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".yml") -gt 0 ]] && echo "YML files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".xml") -gt 0 ]] && echo "info.xml files are modified" && 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 "^tests/") -gt 0 ]] && echo "PHP test files are modified" && exit 0 + +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "/tests/") -gt 0 ]] && echo "PHP test files of an app are modified" && exit 0 + +exit 1 |