Skip to content

Commit

Permalink
Merge pull request #10 from JohnNiang/chore/integrate-with-sonarcloud
Browse files Browse the repository at this point in the history
Integrate with SonarCloud
  • Loading branch information
JohnNiang authored Nov 15, 2023
2 parents c82e13d + 46777b6 commit dee9e3b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/halo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: dorny/paths-filter@v2
id: changes
with:
Expand All @@ -43,6 +49,11 @@ jobs:
run: ./gradlew check
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Analyze code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar --info
- name: Setup console environment
if: steps.changes.outputs.console == 'true'
uses: halo-sigs/actions/admin-env-setup@main
Expand Down
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
id "org.sonarqube" version "4.4.1.3373"
}

group = "run.halo.app"

sonar {
properties {
property "sonar.projectKey", "johnniang_halo"
property "sonar.organization", "johnniang"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.exclusions", "console/**"
}
}

0 comments on commit dee9e3b

Please sign in to comment.