File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -109,11 +109,25 @@ matrix:
109109 if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
110110 git --no-pager diff;
111111 echo "Please fix style issues as shown above";
112- exit 1;
113112 else
114113 echo "Coding style check OK";
115- exit 0;
116114 fi
115+ after_success :
116+ # update status if we succeeded, compare with master if possible
117+ - |
118+ CURR=$(cat astyle.out | grep Formatted | wc -l)
119+ PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
120+ | jq -re "select(.sha != \"$TRAVIS_COMMIT\")
121+ | .statuses[] | select(.context == \"travis-ci/$NAME\").description
122+ | capture(\", (?<warnings>[0-9]+) warnings\").warnings" \
123+ || echo 0)
124+
125+ STATUSM="Passed, ${CURR} warnings"
126+ if [ "$PREV" -ne 0 ]
127+ then
128+ STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") warnings)"
129+ fi
130+ - bash -c "$STATUS" success "$STATUSM"
117131
118132 - env :
119133 - NAME=events
You can’t perform that action at this time.
0 commit comments