diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c119225..91c743c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,36 +1,22 @@
-name: Build
on:
+ # Trigger analysis when pushing in master or pull requests, and when creating
+ # a pull request.
push:
branches:
- beanstalk-java8
pull_request:
types: [opened, synchronize, reopened]
+name: Main Workflow
jobs:
- build:
- name: Build
+ 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 8
- uses: actions/setup-java@v1
- with:
- java-version: 8
- - 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
+ # Disabling shallow clone is recommended for improving relevancy of reporting
+ fetch-depth: 0
+ - name: SonarCloud Scan
+ uses: sonarsource/sonarcloud-github-action@master
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
\ No newline at end of file
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
\ No newline at end of file
diff --git a/ms-launcher/pom.xml b/ms-launcher/pom.xml
index 4b38081..771da40 100644
--- a/ms-launcher/pom.xml
+++ b/ms-launcher/pom.xml
@@ -11,12 +11,6 @@
ms-launcher
-
- sofieneBK_hands-on-hexagonal-architecture-with-spring-boot
- sofienebk
- https://sonarcloud.io
-
-
org.example
diff --git a/sonar-project.properties b/sonar-project.properties
new file mode 100644
index 0000000..12aeb0b
--- /dev/null
+++ b/sonar-project.properties
@@ -0,0 +1,6 @@
+sonar.organization=sofienebk
+sonar.projectKey=sofieneBK_hands-on-hexagonal-architecture-with-spring-boot
+
+# relative paths to source directories. More details and properties are described
+# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
+sonar.sources=.
\ No newline at end of file