Skip to content

Commit

Permalink
Enable Sonarcloud CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidi committed Dec 21, 2024
1 parent cf16b0f commit bbe255d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: [opened, synchronize, reopened]

permissions:
contents: write
Expand All @@ -29,8 +30,23 @@ jobs:
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
dependency-graph: generate-and-submit
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Run CI build
run: ./gradlew build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info

asciidoc-build:
# The type of runner that the job will run on
Expand Down
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.4.1' apply false
id 'io.spring.dependency-management' version '1.1.7'
id "org.sonarqube" version '6.0.1.5171'
}

group = 'zin.rashidi'
Expand All @@ -24,3 +25,11 @@ dependencyManagement {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}

sonar {
properties {
property "sonar.projectKey", "rashidi_spring-boot-tutorials"
property "sonar.organization", "rashidi-github"
property "sonar.host.url", "https://sonarcloud.io"
}
}

0 comments on commit bbe255d

Please sign in to comment.