Skip to content
Permalink
Browse files
ANY23-546 Implement sonarcloud.io in Any23 continuous integration (#241)
* ANY23-546 Implement sonarcloud.io in Any23 continuous integration
  • Loading branch information
lewismc committed Jan 7, 2022
1 parent 87aab94 commit b61f5b8eecbc24b5de54fe1d7b90b35fa12749f8
Showing 3 changed files with 55 additions and 5 deletions.
@@ -20,20 +20,37 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn clean formatter:validate verify javadoc:aggregate test
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B clean formatter:validate verify javadoc:aggregate org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_any23
@@ -6,6 +6,10 @@
[![Jenkins](https://img.shields.io/jenkins/s/https/ci-builds.apache.org/job/Any23/job/any23-master.svg?maxAge=3600)](https://ci-builds.apache.org//job/Any23/job/any23-master/)
[![Jenkins tests](https://img.shields.io/jenkins/t/https/ci-builds.apache.org/job/Any23/job/any23-master.svg?maxAge=3600)](https://ci-builds.apache.org//job/Any23/job/any23-master/lastBuild/testReport/)
[![Maven Central](https://img.shields.io/maven-central/v/org.apache.any23/apache-any23.svg?maxAge=86400)](http://search.maven.org/#search|ga|1|g%3A%22org.apache.any23%22)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_any23&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=apache_any23)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=apache_any23&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=apache_any23)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=apache_any23&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=apache_any23)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=apache_any23&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=apache_any23)

Apache Anything To Triples (Any23) is a library and web service that extracts
structured data in RDF format from a variety of Web documents.
31 pom.xml
@@ -295,6 +295,7 @@
<formatter-maven-plugin.version>2.17.1</formatter-maven-plugin.version>
<ossindex-maven-plugin.version>3.1.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>

<!--
| Any23 website has to be stored in SVN
@@ -304,6 +305,13 @@
<site.urlDeployment>file://${site.filePath}</site.urlDeployment>
<site.scmPubCheckoutDirectory>${site.filePath}</site.scmPubCheckoutDirectory>
<assembly.skip>false</assembly.skip>
<!-- sonarcloud.io static source code analysis
https://issues.apache.org/jira/browse/ANY23-546 -->
<sonar.organization>apache</sonar.organization>
<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>
</properties>

<dependencyManagement>
@@ -918,7 +926,7 @@
Declaring default file encoding: UTF-8
Enabling assertions.
-->
<argLine>-Dfile.encoding=UTF-8 -ea ${surefire-extra-args}</argLine>
<argLine>${argLine} -Dfile.encoding=UTF-8 -ea ${surefire-extra-args}</argLine>
<includes>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
@@ -945,6 +953,26 @@
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

@@ -1238,6 +1266,7 @@
<surefire-extra-args>--add-modules java.xml.bind</surefire-extra-args>
</properties>
</profile>

</profiles>

</project>

0 comments on commit b61f5b8

Please sign in to comment.