xref: /OpenGrok/dev/main (revision bf78b550622fe0e1f9ba169b9d8ec98b7ca99f1c)
1aba5f4cfSVladimir Kotal#!/bin/bash
2aba5f4cfSVladimir Kotal
3aba5f4cfSVladimir Kotal#
4cb86d517SVladimir Kotal# Do not run coverage for forks as most people do not have extra tools enabled
54ff8cd68SVladimir Kotal# for their fork. Avoid it also for release builds as that can fail such
64ff8cd68SVladimir Kotal# build unnecessarily.
7aba5f4cfSVladimir Kotal#
8*bf78b550SVladimir Kotal
9*bf78b550SVladimir Kotalif [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
10*bf78b550SVladimir Kotal	OPENGROK_BRANCH=${OPENGROK_REF#"refs/heads/"}
11*bf78b550SVladimir Kotalfi
12*bf78b550SVladimir Kotal
13aba5f4cfSVladimir Kotalextra_args=""
14*bf78b550SVladimir Kotalif [[ "x$OPENGROK_REPO_SLUG" == "xoracle/opengrok" && "x$OPENGROK_BRANCH" == "xmaster" ]]; then
153db07792SVladimir Kotal	echo "Enabling Coveralls"
16b47b86e8SVladimir Kotal	extra_args="jacoco:report coveralls:report"
1764cffec5SVladimir Kotal
1864cffec5SVladimir Kotal	#
1964cffec5SVladimir Kotal	# Sonar seems to only work on master branch commits.
2064cffec5SVladimir Kotal	#
2164cffec5SVladimir Kotal	if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
2264cffec5SVladimir Kotal		echo "Enabling Sonar"
23cb86d517SVladimir Kotal		extra_args="$extra_args sonar:sonar"
24aba5f4cfSVladimir Kotal	fi
2564cffec5SVladimir Kotalfi
26aba5f4cfSVladimir Kotal
27d5d2ac4cSVladimir Kotal./mvnw -B -V verify $extra_args
28