Skip to content

Commit

Permalink
Only run code coverage CI on merge
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Sep 3, 2019
1 parent ecd0d39 commit 5462d4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,7 @@ steps:
- name: nodb-codecov
image: nextcloudci/php7.1:php7.1-16
commands:
- bash tests/drone-run-coverage.sh || exit 0
- phpenmod xdebug
- TEST_SELECTION=NODB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
Expand Down Expand Up @@ -2243,6 +2244,7 @@ steps:
- name: db-codecov
image: nextcloudci/php7.1:php7.1-16
commands:
- bash tests/drone-run-coverage.sh || exit 0
- phpenmod xdebug
- TEST_SELECTION=QUICKDB ./autotest.sh sqlite
- wget https://codecov.io/bash -O codecov.sh
Expand Down
11 changes: 11 additions & 0 deletions tests/drone-run-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/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

exit 1

0 comments on commit 5462d4b

Please sign in to comment.