Only run phpunit when php, xml or test files are modified
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c099469ece
commit
53c18b8c26
17
.drone.yml
17
.drone.yml
|
@ -253,10 +253,12 @@ steps:
|
||||||
- name: nodb-php7.3
|
- name: nodb-php7.3
|
||||||
image: nextcloudci/php7.3:latest
|
image: nextcloudci/php7.3:latest
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
|
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
|
||||||
- name: nodb-php7.4
|
- name: nodb-php7.4
|
||||||
image: nextcloudci/php7.4:latest
|
image: nextcloudci/php7.4:latest
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
|
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -287,10 +289,12 @@ steps:
|
||||||
- name: sqlite-php7.3
|
- name: sqlite-php7.3
|
||||||
image: nextcloudci/php7.3:php7.3-4
|
image: nextcloudci/php7.3:php7.3-4
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
|
||||||
- name: sqlite-php7.4
|
- name: sqlite-php7.4
|
||||||
image: nextcloudci/php7.4:2
|
image: nextcloudci/php7.4:2
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -317,6 +321,7 @@ steps:
|
||||||
- name: mariadb10.1-php7.2
|
- name: mariadb10.1-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -352,6 +357,7 @@ steps:
|
||||||
- name: mariadb10.2-php7.2
|
- name: mariadb10.2-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -386,6 +392,7 @@ steps:
|
||||||
- name: mariadb10.3-php7.2
|
- name: mariadb10.3-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -420,6 +427,7 @@ steps:
|
||||||
- name: mariadb10.4-php7.3
|
- name: mariadb10.4-php7.3
|
||||||
image: nextcloudci/php7.3:php7.3-4
|
image: nextcloudci/php7.3:php7.3-4
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -455,6 +463,7 @@ steps:
|
||||||
- name: mysql-php7.2
|
- name: mysql-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -491,6 +500,7 @@ steps:
|
||||||
- name: mysql-php7.2
|
- name: mysql-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -523,6 +533,7 @@ steps:
|
||||||
- name: mysql-php7.3
|
- name: mysql-php7.3
|
||||||
image: nextcloudci/php7.3:php7.3-4
|
image: nextcloudci/php7.3:php7.3-4
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -555,6 +566,7 @@ steps:
|
||||||
- name: mysql5.6-php7.2
|
- name: mysql5.6-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -589,6 +601,7 @@ steps:
|
||||||
- name: postgres-php7.3
|
- name: postgres-php7.3
|
||||||
image: nextcloudci/php7.3:php7.3-4
|
image: nextcloudci/php7.3:php7.3-4
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- sleep 10 # gives the database enough time to initialize
|
- sleep 10 # gives the database enough time to initialize
|
||||||
- POSTGRES=9 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
- POSTGRES=9 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
||||||
|
|
||||||
|
@ -624,6 +637,7 @@ steps:
|
||||||
- name: postgres-php7.2
|
- name: postgres-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- sleep 10 # gives the database enough time to initialize
|
- sleep 10 # gives the database enough time to initialize
|
||||||
- POSTGRES=10 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
- POSTGRES=10 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
||||||
|
|
||||||
|
@ -658,6 +672,7 @@ steps:
|
||||||
- name: postgres-php7.2
|
- name: postgres-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- sleep 10 # gives the database enough time to initialize
|
- sleep 10 # gives the database enough time to initialize
|
||||||
- POSTGRES=11 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
- POSTGRES=11 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
|
||||||
|
|
||||||
|
@ -693,6 +708,7 @@ steps:
|
||||||
- name: mysqlmb4-php7.2
|
- name: mysqlmb4-php7.2
|
||||||
image: nextcloudci/php7.2:php7.2-13
|
image: nextcloudci/php7.2:php7.2-13
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -728,6 +744,7 @@ steps:
|
||||||
- name: mysqlmb4-php7.3
|
- name: mysqlmb4-php7.3
|
||||||
image: nextcloudci/php7.3:php7.3-4
|
image: nextcloudci/php7.3:php7.3-4
|
||||||
commands:
|
commands:
|
||||||
|
- bash tests/drone-run-php-tests.sh || exit 0
|
||||||
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
|
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
|
@ -8,6 +8,8 @@ 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 | 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 ".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 ".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
|
[[ $(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
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/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 ".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
|
Loading…
Reference in New Issue