Skip to content

Commit

Permalink
feat: add Sonar analysis to build pipeline (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
szatyinadam authored Oct 11, 2021
1 parent 050da9a commit 6f4327b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ To run GitHub workflow, a few environment variables needs to add in GitHub secre
<td> Docker hub password/token with push permission </td>
<td> **** </td>
</tr>
<tr>
<td> SONAR_TOKEN </td>
<td> <a href="https://sonarcloud.io">SonarCloud</a> token </td>
<td> **** </td>
</tr>
27 changes: 27 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: sonar
on:
pull_request:
branches:
- main
- v*
paths:
- 'frontend/**'
defaults:
run:
working-directory: frontend
jobs:
sonar-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Sonar analysis
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: frontend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

6 changes: 6 additions & 0 deletions frontend/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=szatyinadam
sonar.projectKey=szatyinadam_signoz

# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./src

0 comments on commit 6f4327b

Please sign in to comment.