Skip to content

Commit c3b6ca0

Browse files
authored
TA-4413: Add sonarcloud integration (#282)
1 parent b22f10f commit c3b6ca0

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: SonarCloud Scan
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
name: Build and analyze
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
23+
- name: Install dependencies
24+
run: yarn install
25+
26+
- name: Build project
27+
run: yarn build
28+
29+
- name: Run tests and collect coverage
30+
run: yarn test --coverage --coverageReporters=lcov
31+
32+
- name: SonarCloud Scan
33+
uses: SonarSource/sonarcloud-github-action@master
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Project identification
2+
sonar.projectKey=celonis_content-cli
3+
sonar.organization=celonis
4+
sonar.projectName=Content CLI
5+
6+
# Source code location
7+
sonar.sources=src
8+
9+
# Test location
10+
sonar.tests=tests
11+
12+
# Encoding
13+
sonar.sourceEncoding=UTF-8
14+
15+
# Coverage reporting (from Jest / ts-jest)
16+
sonar.javascript.lcov.reportPaths=coverage/lcov.info
17+
18+
# Exclusions (optional, adjust as needed)
19+
# Ignore built files and configs
20+
sonar.exclusions=dist/**, node_modules/**, coverage/**, **/*.test.ts
21+
22+
# Test file inclusions
23+
sonar.test.inclusions=**/*.test.ts, **/*.spec.ts
24+
25+
# Report verbose output
26+
sonar.verbose=true

0 commit comments

Comments
 (0)