Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,17 @@ steps:
- name: nodb-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
- name: nodb-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
- name: nodb-php7.4
image: nextcloudci/php7.4:2
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite

services:
Expand All @@ -306,14 +309,17 @@ steps:
- name: sqlite-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
- name: sqlite-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
- name: sqlite-php7.4
image: nextcloudci/php7.4:2
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite

services:
Expand All @@ -340,6 +346,7 @@ steps:
- name: mariadb10.1-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
Expand Down Expand Up @@ -375,6 +382,7 @@ steps:
- name: mariadb10.2-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
Expand Down Expand Up @@ -409,6 +417,7 @@ steps:
- name: mariadb10.3-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
Expand Down Expand Up @@ -443,6 +452,7 @@ steps:
- name: mariadb10.4-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
Expand Down Expand Up @@ -478,6 +488,7 @@ steps:
- name: mysql-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql

services:
Expand Down Expand Up @@ -514,6 +525,7 @@ steps:
- name: mysql-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql

services:
Expand Down Expand Up @@ -546,6 +558,7 @@ steps:
- name: mysql-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql

services:
Expand Down Expand Up @@ -578,6 +591,7 @@ steps:
- name: mysql5.6-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql

services:
Expand Down Expand Up @@ -612,6 +626,7 @@ steps:
- name: postgres-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- sleep 10 # gives the database enough time to initialize
- POSTGRES=9 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

Expand Down Expand Up @@ -647,6 +662,7 @@ steps:
- name: postgres-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- sleep 10 # gives the database enough time to initialize
- POSTGRES=10 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

Expand Down Expand Up @@ -681,6 +697,7 @@ steps:
- name: postgres-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- sleep 10 # gives the database enough time to initialize
- POSTGRES=11 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

Expand Down Expand Up @@ -716,6 +733,7 @@ steps:
- name: mysqlmb4-php7.2
image: nextcloudci/php7.2:php7.2-13
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4

services:
Expand Down Expand Up @@ -751,6 +769,7 @@ steps:
- name: mysqlmb4-php7.3
image: nextcloudci/php7.3:php7.3-4
commands:
- bash tests/drone-run-php-tests.sh || exit 0
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4

services:
Expand Down
8 changes: 8 additions & 0 deletions tests/drone-run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions tests/drone-run-php-tests.sh
Original file line number Diff line number Diff line change
@@ -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