Skip to content

Commit e38b46c

Browse files
authored
chore: update SonarQube workflow and configuration for improved code quality analysis (#20)
1 parent 6f59577 commit e38b46c

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/sonar.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@ jobs:
1010
name: SonarQube
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1415
with:
1516
fetch-depth: 0
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: 'pnpm'
24+
- name: Install deps
25+
run: pnpm install
26+
- name: Run tests with coverage (LCOV)
27+
run: pnpm test:coverage
1628
- name: SonarQube Scan
1729
uses: SonarSource/sonarqube-scan-action@v5
1830
env:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
"vitest": "^3.2.4"
101101
},
102102
"engines": {
103-
"node": ">=20"
103+
"node": ">=20",
104+
"pnpm": ">=9"
104105
},
105106
"repository": {
106107
"type": "git",

sonar-project.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
sonar.projectKey=dorixdev_react-dual-scroll-sync
22
sonar.organization=dorixdev
3+
sonar.sources=lib
4+
sonar.tests=lib
5+
sonar.test.inclusions=**/*.{test,spec}.{ts,tsx}
6+
sonar.javascript.lcov.reportPaths=coverage/lcov.info

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default defineConfig({
5353
'**/lib/**/*.types.{js,ts,jsx,tsx}'
5454
],
5555
provider: 'v8',
56-
reporter: ['html', 'clover', 'json', 'text', 'text-summary']
56+
reporter: ['html', 'text', 'text-summary', 'lcov']
5757
}
5858
},
5959
resolve: {

0 commit comments

Comments
 (0)