Skip to content
Permalink
Browse files
ANY23-588 Add code coverage metrics to Sonarcloud.io analysis (#276)
  • Loading branch information
lewismc committed Apr 12, 2022
1 parent 1b21982 commit 9addd6c0385f61a11e8059e9c4bfdaf2ef063a58
Showing 3 changed files with 92 additions and 4 deletions.
@@ -54,10 +54,12 @@ jobs:
if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }}
run: >
mvn sonar:sonar
-Dsonar.projectKey=apache_any23
-Dsonar.organization=apache
-Dsonar.coverage.jacoco.xmlReportPaths=jacoco-report-aggregate/target/site/jacoco-aggregate/jacoco.xml
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$SONAR_TOKEN
-Dsonar.organization=apache
-Dsonar.projectKey=apache_any23
-Dsonar.verbose=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>apache-any23</artifactId>
<groupId>org.apache.any23</groupId>
<version>2.8-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

<artifactId>jacoco-report-aggregate</artifactId>

<name>Apache Any23 :: JaCoCo Report Aggregate</name>
<description>Special Maven module containing nothing except a pom.xml that uses the JaCoCo report-aggregate goal.</description>

<dependencies>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-csvutils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-encoding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-mime</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
@@ -231,6 +231,7 @@
<module>encoding</module>
<module>core</module>
<module>cli</module>
<module>jacoco-report-aggregate</module>
</modules>

<scm>
@@ -324,7 +325,7 @@
<formatter-maven-plugin.version>2.18.0</formatter-maven-plugin.version>
<ossindex-maven-plugin.version>3.2.0</ossindex-maven-plugin.version>
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>

<!--
| Any23 website has to be stored in SVN
@@ -340,7 +341,8 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
<sonar.projectVersion>${project.version}</sonar.projectVersion>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/jacoco-report-aggregate/target/site/
jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<dependencyManagement>

0 comments on commit 9addd6c

Please sign in to comment.