Skip to content

Commit 87599ef

Browse files
authored
Merge pull request #5 from aboudard/sonar-patch-1
sonar cloud config Action
2 parents 0e79581 + 0d40f82 commit 87599ef

File tree

3 files changed

+67
-12
lines changed

3 files changed

+67
-12
lines changed

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [ opened, synchronize, reopened ]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: 17
20+
distribution: 'zulu' # Alternative distribution options are available.
21+
- name: Cache SonarCloud packages
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.sonar/cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache Maven packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.m2
31+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-m2
33+
- name: Build and analyze
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aboudard_springboot-module-federation

pom.xml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>org.springframework</groupId>
7-
<artifactId>module-federation</artifactId>
8-
<version>0.0.1-SNAPSHOT</version>
9-
<packaging>pom</packaging>
6+
<groupId>org.springframework</groupId>
7+
<artifactId>module-federation</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>pom</packaging>
1010

11-
<modules>
12-
<module>library</module>
13-
<module>application</module>
14-
<module>core</module>
15-
</modules>
11+
<modules>
12+
<module>library</module>
13+
<module>application</module>
14+
<module>core</module>
15+
</modules>
16+
17+
<properties>
18+
<sonar.organization>aboudard</sonar.organization>
19+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
20+
</properties>
1621

1722
</project>

sonar-project.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sonar.projectKey = aboudard_springboot-module-federation
2+
sonar.organization = aboudard
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
sonar.projectName = springboot-module-federation
6+
sonar.projectVersion = 1.0
7+
8+
9+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10+
#sonar.sources=.
11+
12+
# Encoding of the source code. Default is default system encoding
13+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)