Skip to content

Commit

Permalink
Add Sonar Configuration (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdenarie authored Jun 21, 2021
1 parent b468899 commit c813b66
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 11 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Sonar Analysis
on:
push:
branches:
- develop
pull_request:
jobs:
build:
name: Analyse Module with SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- 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 compile org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
56 changes: 45 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,37 @@ along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent-pom</artifactId>
<groupId>org.exoplatform</groupId>
<version>23-M12</version>
<relativePath />
<relativePath/>
</parent>

<name>GateIn - Web Container Integration</name>

<groupId>org.exoplatform.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
<version>6.2.x-SNAPSHOT</version>
<packaging>pom</packaging>

<scm>
<connection>scm:git:git://github.com/meeds-io/gatein-wci.git</connection>
<developerConnection>scm:git:ssh://[email protected]/meeds-io/gatein-wci.git</developerConnection>
<url>https://github.com/meeds-io/gatein-wci</url>
</scm>

<properties>
<!-- Config for eXo Release Manager-->
<org.exoplatform.depmgt.version>19.x-SNAPSHOT</org.exoplatform.depmgt.version>
<!-- Config for eXo Release Manager-->
<org.exoplatform.depmgt.version>19.x-SNAPSHOT</org.exoplatform.depmgt.version>

<!-- Sonar properties -->
<sonar.organization>meeds-io</sonar.organization>
</properties>

<dependencyManagement>
<dependencies>
<!-- Import versions of external dependencies to use -->
Expand All @@ -52,7 +56,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Internal dependencies -->
<dependency>
<groupId>org.exoplatform.gatein.wci</groupId>
Expand Down Expand Up @@ -84,11 +88,41 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</dependency>
</dependencies>
</dependencyManagement>

<modules>
<module>wci</module>
<module>tomcat</module>
<module>test</module>
</modules>

<!-- This profile is used to allow github action to build branches. The github action is used for sonar analysis -->
<profiles>
<profile>
<id>project-repositories</id>
<activation>
<property>
<name>!skip-project-repositories</name>
</property>
</activation>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>repository.exoplatform.org</id>
<url>https://repository.exoplatform.org/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>repository.exoplatform.org</id>
<url>https://repository.exoplatform.org/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

</project>

0 comments on commit c813b66

Please sign in to comment.