Skip to content

Commit

Permalink
Update sonar-branch.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Nasic-Elvis authored Feb 10, 2024
1 parent 5a7d31c commit ac163b8
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/sonar-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@
# specific language governing permissions and limitations
# under the License.

name: Sonar Quality Branch Analysis
name: Sonar Quality Analysis on All Commits and Export Compiled Artifact

on:
push:
branches:
- master
- 'ignite-[0-9].[0-9]+.[0-9]+*'
on: push # Analisi su ogni push in qualsiasi branch

jobs:
sonarcloud:
name: Sonar Analysis
name: Sonar Analysis and Export Artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 0 # Importante per l'analisi SonarCloud per ottenere la storia completa

- name: Setup java
uses: actions/setup-java@v3
Expand All @@ -53,24 +49,25 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Install Libnuma
- name: Install Libnuma # Solo se necessario per il tuo progetto
run: sudo apt-get update && sudo apt-get install libnuma-dev

- name: Build with Maven
run: |
./mvnw install -P all-java,lgpl,examples,skip-docs -DskipTests -B -V
- name: Build with Maven # Personalizza questo passaggio in base alla tua configurazione di Maven
run: ./mvnw install -P all-java,lgpl,examples,skip-docs -DskipTests -B -V

- name: Sonar Analyze Upload
run: >
./mvnw org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-P all-java,lgpl,examples,skip-docs
-Dsonar.branch.name=${{ github.ref_name }}
-Dsonar.projectKey=UnimibEsami_ignite
-Dsonar.organization=unimibesami
-Dsonar.host.url=https://sonarcloud.io
- name: SonarCloud Analysis
uses: SonarSource/sonarcloud-github-action@master
env:
MAVEN_OPTS: "-XX:+UseG1GC -XX:InitialHeapSize=2g -XX:MaxHeapSize=6g -XX:+UseStringDeduplication"
SONAR_OPTS: "-XX:+UseG1GC -XX:InitialHeapSize=2g -XX:MaxHeapSize=6g -XX:+UseStringDeduplication"
JAVA_OPTS: "-XX:+UseG1GC -XX:InitialHeapSize=2g -XX:MaxHeapSize=6g -XX:+UseStringDeduplication"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectKey=UnimibEsami_ignite
-Dsonar.organization=unimibesami
-Dsonar.host.url=https://sonarcloud.io
- name: Upload Compiled Artifact # Passo per caricare l'artefatto compilato
uses: actions/upload-artifact@v3
with:
name: Compiled-Project # Nome dell'artefatto
path: target/*.jar # Percorso dell'artefatto compilato, adattalo in base alla tua struttura di progetto

0 comments on commit ac163b8

Please # to comment.