Skip to content

Commit 41ca0ba

Browse files
ginoaugustinevladak
authored andcommitted
Use Sonarqube for code coeverage tracking
Signed-off-by: Gino Augustine <[email protected]>
1 parent 6218ccf commit 41ca0ba

File tree

4 files changed

+60
-77
lines changed

4 files changed

+60
-77
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ jobs:
5353
OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
5454
OPENGROK_REPO_SLUG: ${{ github.repository }}
5555
OPENGROK_REF: ${{ github.ref }}
56-
OPENGROK_COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
5756
OPENGROK_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5857
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5958
run: ./dev/main

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Copyright (c) 2006, 2023 Oracle and/or its affiliates. All rights reserved.
44

55
# OpenGrok - a wicked fast source browser
66
[![Github actions build](https://github.com/oracle/opengrok/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/oracle/opengrok/actions)
7-
[![Coverage status](https://coveralls.io/repos/oracle/opengrok/badge.svg?branch=master)](https://coveralls.io/r/oracle/opengrok?branch=master)
7+
[![Coverage status](https://sonarcloud.io/api/project_badges/measure?project=org.opengrok%3Aopengrok-top&metric=coverage)](https://sonarcloud.io/summary/new_code?id=org.opengrok%3Aopengrok-top)
88
[![SonarQube status](https://sonarcloud.io/api/project_badges/measure?project=org.opengrok%3Aopengrok-top&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.opengrok%3Aopengrok-top)
99
[![License](https://img.shields.io/badge/License-CDDL%201.0-blue.svg)](https://opensource.org/licenses/CDDL-1.0)
1010

1111
- [OpenGrok - a wicked fast source browser](#opengrok---a-wicked-fast-source-browser)
1212
- [1. Introduction](#1-introduction)
13-
- [2. OpenGrok install and setup](#2-opengrok-install-and-setup)
13+
- [2. OpenGrok install and setup](#2-Installation)
1414
- [3. Information for developers](#3-information-for-developers)
1515
- [4. Authors](#4-authors)
1616
- [5. Contact us](#5-contact-us)
@@ -34,9 +34,9 @@ See https://github.com/oracle/opengrok/wiki/How-to-setup-OpenGrok
3434

3535
OpenGrok uses [semantic versioning](https://semver.org/) and the version components further indicate more details about updating to newer version. The version scheme is *major.minor.micro* and change in any component is interpreted as:
3636

37-
- major - major backwards incompatible update, will require full reindex as well as configuration changes
38-
- minor - full clean reindex of your repositories is needed (e. g. index format has changed)
39-
- micro - redeploy web application
37+
- major - major backwards incompatible update, will require full reindex as well as configuration changes
38+
- minor - full clean reindex of your repositories is needed (e. g. index format has changed)
39+
- micro - redeploy web application
4040

4141
Generally it is possible to go backward only within the micro version.
4242

dev/main

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ if [[ -n $OPENGROK_REF && $OPENGROK_REF == refs/heads/* ]]; then
1111
fi
1212

1313
extra_args=""
14-
if [[ "x$OPENGROK_REPO_SLUG" == "xoracle/opengrok" && "x$OPENGROK_BRANCH" == "xmaster" ]]; then
15-
echo "Enabling Coveralls"
16-
if [[ -n $OPENGROK_COVERALLS_TOKEN ]]; then
17-
extra_args="$extra_args -DrepoToken=$OPENGROK_COVERALLS_TOKEN"
18-
fi
19-
extra_args="$extra_args jacoco:report coveralls:report"
14+
15+
if [[ "x$OPENGROK_REPO_SLUG" == "xoracle/opengrok" &&
16+
-z "${OPENGROK_PULL_REQUEST}" &&
17+
"x$OPENGROK_BRANCH" == "xmaster" ]]; then
18+
echo "Enabling Jacoco Coverage"
19+
extra_args="$extra_args jacoco:report "
2020

2121
#
22-
# Sonar seems to only work on master branch commits.
22+
# Enable sonar for master branch linux build
2323
#
24-
if [[ -z "${OPENGROK_PULL_REQUEST}" ]]; then
24+
if [[ "$RUNNER_OS" == "Linux" ]]; then
2525
echo "Enabling Sonar"
2626
extra_args="$extra_args -P sonar -Dsonar.login=$OPENGROK_SONAR_TOKEN sonar:sonar"
2727
fi

pom.xml

Lines changed: 47 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -217,23 +217,23 @@ Portions Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
217217
<artifactId>maven-enforcer-plugin</artifactId>
218218
<version>3.4.1</version>
219219
<executions>
220-
<execution>
221-
<id>enforce-maven</id>
222-
<goals>
223-
<goal>enforce</goal>
224-
</goals>
225-
<configuration>
226-
<rules>
227-
<banDuplicatePomDependencyVersions/>
228-
<requireMavenVersion>
229-
<version>3.0.5</version>
230-
</requireMavenVersion>
231-
<requireJavaVersion>
232-
<version>${java.version}</version>
233-
</requireJavaVersion>
234-
</rules>
235-
</configuration>
236-
</execution>
220+
<execution>
221+
<id>enforce-maven</id>
222+
<goals>
223+
<goal>enforce</goal>
224+
</goals>
225+
<configuration>
226+
<rules>
227+
<banDuplicatePomDependencyVersions/>
228+
<requireMavenVersion>
229+
<version>3.0.5</version>
230+
</requireMavenVersion>
231+
<requireJavaVersion>
232+
<version>${java.version}</version>
233+
</requireJavaVersion>
234+
</rules>
235+
</configuration>
236+
</execution>
237237
</executions>
238238
</plugin>
239239
<plugin>
@@ -252,11 +252,11 @@ Portions Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
252252
<release>${java.version}</release>
253253
<encoding>${project.build.sourceEncoding}</encoding>
254254
<compilerArgs>
255-
<arg>-Xlint:all</arg>
256-
<arg>-Werror</arg>
257-
<!-- meant for autogenerated sources -->
258-
<arg>-Xlint:-auxiliaryclass</arg>
259-
<arg>-Xlint:-fallthrough</arg>
255+
<arg>-Xlint:all</arg>
256+
<arg>-Werror</arg>
257+
<!-- meant for autogenerated sources -->
258+
<arg>-Xlint:-auxiliaryclass</arg>
259+
<arg>-Xlint:-fallthrough</arg>
260260
</compilerArgs>
261261
</configuration>
262262
<version>3.11.0</version>
@@ -305,33 +305,17 @@ Portions Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
305305
</execution>
306306
</executions>
307307
</plugin>
308-
<plugin>
309-
<groupId>org.eluder.coveralls</groupId>
310-
<artifactId>coveralls-maven-plugin</artifactId>
311-
<version>4.3.0</version>
312-
<dependencies>
313-
<!-- Explicit dep on jaxb-api to avoid problems with
314-
JDK9 and later, until a new version of
315-
coveralls-maven-plugin is released.
316-
See also https://github.com/trautonen/coveralls-maven-plugin/issues/112-->
317-
<dependency>
318-
<groupId>javax.xml.bind</groupId>
319-
<artifactId>jaxb-api</artifactId>
320-
<version>2.3.1</version>
321-
</dependency>
322-
</dependencies>
323-
</plugin>
324308
<plugin>
325309
<groupId>org.apache.maven.plugins</groupId>
326310
<artifactId>maven-javadoc-plugin</artifactId>
327311
<version>${mavenjavadocplugin.version}</version>
328312
<executions>
329-
<execution>
330-
<goals>
331-
<goal>javadoc</goal>
332-
</goals>
333-
<phase>verify</phase>
334-
</execution>
313+
<execution>
314+
<goals>
315+
<goal>javadoc</goal>
316+
</goals>
317+
<phase>verify</phase>
318+
</execution>
335319
</executions>
336320
<configuration>
337321
<verbose>true</verbose>
@@ -345,7 +329,7 @@ Portions Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
345329
</configuration>
346330
</plugin>
347331
<plugin>
348-
<artifactId>maven-project-info-reports-plugin</artifactId>
332+
<artifactId>maven-project-info-reports-plugin</artifactId>
349333
<version>3.4.5</version>
350334
</plugin>
351335
<plugin>
@@ -424,24 +408,24 @@ Portions Copyright (c) 2018, 2020, Chris Fraire <[email protected]>.
424408
</build>
425409
</profile>
426410
<profile>
427-
<id>sonar</id>
428-
<properties>
429-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
430-
<sonar.organization>opengrok</sonar.organization>
431-
</properties>
432-
<build>
433-
<plugins>
434-
<plugin>
435-
<groupId>org.jacoco</groupId>
436-
<artifactId>jacoco-maven-plugin</artifactId>
437-
</plugin>
438-
<plugin>
439-
<groupId>org.sonarsource.scanner.maven</groupId>
440-
<artifactId>sonar-maven-plugin</artifactId>
441-
<version>3.9.1.2184</version>
442-
</plugin>
443-
</plugins>
444-
</build>
411+
<id>sonar</id>
412+
<properties>
413+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
414+
<sonar.organization>opengrok</sonar.organization>
415+
</properties>
416+
<build>
417+
<plugins>
418+
<plugin>
419+
<groupId>org.jacoco</groupId>
420+
<artifactId>jacoco-maven-plugin</artifactId>
421+
</plugin>
422+
<plugin>
423+
<groupId>org.sonarsource.scanner.maven</groupId>
424+
<artifactId>sonar-maven-plugin</artifactId>
425+
<version>3.9.1.2184</version>
426+
</plugin>
427+
</plugins>
428+
</build>
445429
</profile>
446430
</profiles>
447431

0 commit comments

Comments
 (0)