xref: /OpenGrok/dev/main (revision d06d067eed9418bf1b3676bef8cdc5e72ae10952)
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#
8bf78b550SVladimir Kotal
9bf78b550SVladimir Kotalif [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
10bf78b550SVladimir Kotal	OPENGROK_BRANCH=${OPENGROK_REF#"refs/heads/"}
11bf78b550SVladimir Kotalfi
12bf78b550SVladimir Kotal
13aba5f4cfSVladimir Kotalextra_args=""
14bf78b550SVladimir 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	#
21*d06d067eSVladimir Kotal	if [ "${OPENGROK_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