Skip to content

Commit

Permalink
ci: add setup for Sonar analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Mar 2, 2023
1 parent 2009ef2 commit f3d7fc9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ jobs:
with:
from: ${{ steps.set-shas.outputs.base }}

# TODO:
# - name: SonarCloud Scan
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# for now we just have one lib in the monorepo, so we can just use its version to qualify the sonar quality gate new code
- name: Get nx-heroku version
id: nx-heroku-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/nx-heroku

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ steps.nx-heroku-version.outputs.current-version }}
10 changes: 10 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sonar.organization=getlarge
sonar.projectKey=getlarge_nx-heroku
sonar.projectName=nx-heroku
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.inclusions=**/*.ts
sonar.exclusions=dist/*,**/fixtures/*,**/cache/*,**/*spec.ts
sonar.cpd.exclusions=**/*spec.ts
sonar.coverage.exclusions=**/*spec.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info

0 comments on commit f3d7fc9

Please sign in to comment.