-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vsc1cob
committed
Jan 20, 2025
1 parent
d0244c0
commit 653a65a
Showing
1 changed file
with
25 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
name: SonarCloud Analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' # Trigger for all branches | ||
pull_request: | ||
branches: | ||
- master # Trigger for pull requests targeting the master branch | ||
workflow_dispatch: # Allow for manual trigger via GitHub UI | ||
workflow_call: # This workflow can be called from other workflows | ||
|
||
runs-on: self-hosted | ||
jobs: | ||
sonarcloud-analysis: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
steps: | ||
# Checkout the repository | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
# Set up Java | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
# Set up Java | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# SonarCloud Analysis | ||
- name: SonarCloud Analysis | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_ORG: your-organization # Replace with your actual SonarCloud organization | ||
SONAR_HOST_URL: https://sonarcloud.io | ||
run: | | ||
mvn clean verify sonar:sonar \ | ||
-Dsonar.organization=${{ secrets.SONAR_ORG }} \ | ||
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ | ||
-Dsonar.login=${{ secrets.SONAR_TOKEN }} | ||
# SonarCloud Analysis (separate job) | ||
- name: SonarCloud Analysis | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_ORG: your-organization # Replace with your actual SonarCloud organization | ||
SONAR_HOST_URL: https://sonarcloud.io | ||
run: | | ||
mvn clean verify sonar:sonar \ | ||
-Dsonar.organization=${{ secrets.SONAR_ORG }} \ | ||
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ | ||
-Dsonar.login=${{ secrets.SONAR_TOKEN }} |