Revert "Create sonarqube.yml" #2
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
name: SonarQube Scan | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
sonarQube: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK 22 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '22' | |
- name: Cache SonarQube packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar-cache | |
restore-keys: | | |
${{ runner.os }}-sonar-cache | |
- name: SonarQube Scan | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: mvn clean verify sonar:sonar -Dsonar.projectKey=<your_project_key> -Dsonar.host.url=<your_sonarqube_server_url> -Dsonar.login=${{ secrets.SONAR_TOKEN }} | |
- name: Upload SonarQube results | |
if: always() | |
run: | | |
echo "Uploading SonarQube results" |