xref: /OpenGrok/dev/main (revision 3db077920d1d4409c4035e34100d268854cd6e9a)
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
5aba5f4cfSVladimir Kotal# for their fork.
6aba5f4cfSVladimir Kotal#
7aba5f4cfSVladimir Kotalextra_args=""
8aba5f4cfSVladimir Kotalif [ "x$TRAVIS_REPO_SLUG" == "xoracle/opengrok" ]; then
9bcda0b79SVladimir Kotal	# Code coverage is published only for JDK 8 because the
10bcda0b79SVladimir Kotal	# coveralls-maven-plugin does not work with JDK 9+
11bcda0b79SVladimir Kotal	# (https://github.com/trautonen/coveralls-maven-plugin/issues/112)
12bcda0b79SVladimir Kotal	if [ "x$TRAVIS_JDK_VERSION" == "xoraclejdk8" ]; then
13*3db07792SVladimir Kotal		echo "Enabling Coveralls"
14aba5f4cfSVladimir Kotal		extra_args="jacoco:report org.eluder.coveralls:coveralls-maven-plugin:report"
15bcda0b79SVladimir Kotal	fi
1664cffec5SVladimir Kotal
1764cffec5SVladimir Kotal	#
1864cffec5SVladimir Kotal	# Sonar seems to only work on master branch commits.
1964cffec5SVladimir Kotal	#
2064cffec5SVladimir Kotal	if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
2164cffec5SVladimir Kotal		echo "Enabling Sonar"
22cb86d517SVladimir Kotal		extra_args="$extra_args sonar:sonar"
23aba5f4cfSVladimir Kotal	fi
2464cffec5SVladimir Kotalfi
25aba5f4cfSVladimir Kotal
268aef88daSVladimir Kotalret=0
278aef88daSVladimir Kotalmvn -B -V verify $extra_args || ret=1
288aef88daSVladimir Kotalnode dev/parse.js || ret=1
298aef88daSVladimir Kotalexit $ret
30