Skip to content

Commit

Permalink
Add SonarCloud analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
bdhoine committed Aug 5, 2023
1 parent 07eaa72 commit 8ec2cf3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
2 changes: 1 addition & 1 deletion all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>${package.group}</group>
<group>${project.artifactId}</group>
<packageType>container</packageType>
<properties>
<cloudManagerTarget>all</cloudManagerTarget>
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@
<aem.version>6.5.10</aem.version>
<groovy.version>4.0.9</groovy.version>

<package.group>aem-groovy-console</package.group>
<!-- SonarCloud -->
<sonar.organization>orbinson</sonar.organization>
<sonar.projectKey>${sonar.organization}_${project.artifactId}</sonar.projectKey>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<!-- AEM -->
<vault.password>admin</vault.password>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion ui.apps.aem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>${package.group}</group>
<group>${project.artifactId}</group>
<name>aem-groovy-console-ui.apps.aem</name>
<packageType>application</packageType>
<accessControlHandling>merge</accessControlHandling>
Expand Down
2 changes: 1 addition & 1 deletion ui.apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>${package.group}</group>
<group>${project.artifactId}</group>
<name>aem-groovy-console-ui.apps</name>
<packageType>application</packageType>
<accessControlHandling>merge</accessControlHandling>
Expand Down
2 changes: 1 addition & 1 deletion ui.content/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>${package.group}</group>
<group>${project.artifactId}</group>
<name>aem-groovy-console-ui.content</name>
<packageType>content</packageType>
<accessControlHandling>merge</accessControlHandling>
Expand Down

0 comments on commit 8ec2cf3

Please sign in to comment.