Skip to content

Commit d7bff3e

Browse files
chore: setup GitHub action for SonarCloud analysis (#977)
1 parent 7001d6c commit d7bff3e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/sonar-cloud.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- release/**/*
7+
- feat/*
8+
- feat-*
9+
- fix/*
10+
- fix-*
11+
- lw-*
12+
pull_request:
13+
types: [opened, synchronize, reopened]
14+
jobs:
15+
sonarcloud:
16+
name: SonarCloud Code Analysis
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
22+
- name: SonarCloud Scan
23+
uses: SonarSource/sonarcloud-github-action@master
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
26+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectKey=input-output-hk_lace
2+
sonar.organization=input-output-hk
3+
4+
sonar.projectName=lace
5+
sonar.projectVersion=1.0
6+
7+
sonar.inclusions=apps/**/*,packages/**/*
8+
sonar.exclusions=packages/e2e-tests/**/*,**/test/**/*,**/__tests__/**/*,**/*.stories.tsx,**/*.test.ts,**/*.test.tsx
9+
sonar.tests.inclusions=apps/**/__tests__/**/*,packages/**/__tests__/**/*,**/*.test.ts,**/*.test.tsx
10+
11+
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)