From a4795ddd68fb38dbd6d5ba97c0dabc5f8f240ca6 Mon Sep 17 00:00:00 2001 From: J Alfonso Martinez Date: Thu, 4 Sep 2025 12:37:57 -0600 Subject: [PATCH 1/3] chore: update SonarQube workflow and configuration for improved code quality analysis --- .github/workflows/sonar.yml | 13 ++++++++++++- sonar-project.properties | 4 ++++ vite.config.ts | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 5c171e4..f633ef2 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -10,9 +10,20 @@ jobs: name: SonarQube runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: 'pnpm' + - name: Setup pnpm + uses: pnpm/action-setup@v4 + - name: Install deps + run: pnpm install + - name: Run tests with coverage (LCOV) + run: pnpm test:coverage - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@v5 env: diff --git a/sonar-project.properties b/sonar-project.properties index 65e0dcc..274ec5d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,6 @@ sonar.projectKey=dorixdev_react-dual-scroll-sync sonar.organization=dorixdev +sonar.sources=lib +sonar.tests=lib +sonar.test.inclusions=**/*.{test,spec}.{ts,tsx} +sonar.javascript.lcov.reportPaths=coverage/lcov.info diff --git a/vite.config.ts b/vite.config.ts index 28e55e9..948e67e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -53,7 +53,7 @@ export default defineConfig({ '**/lib/**/*.types.{js,ts,jsx,tsx}' ], provider: 'v8', - reporter: ['html', 'clover', 'json', 'text', 'text-summary'] + reporter: ['html', 'text', 'text-summary', 'lcov'] } }, resolve: { From 97e6e11185019ec09d6235432e1a1d4e0586b124 Mon Sep 17 00:00:00 2001 From: J Alfonso Martinez Date: Thu, 4 Sep 2025 12:44:08 -0600 Subject: [PATCH 2/3] chore: update Node.js and pnpm version requirements in package.json and sonar.yml --- .github/workflows/sonar.yml | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index f633ef2..20c571c 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -17,9 +17,12 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: + node-version: '22' cache: 'pnpm' - name: Setup pnpm uses: pnpm/action-setup@v4 + with: + version: 10 - name: Install deps run: pnpm install - name: Run tests with coverage (LCOV) diff --git a/package.json b/package.json index 6e0bb29..decf7ea 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,8 @@ "vitest": "^3.2.4" }, "engines": { - "node": ">=20" + "node": ">=20", + "pnpm": ">=9" }, "repository": { "type": "git", From f138a2b2123dd5ea59f9e6c78b7ca937c12d7a72 Mon Sep 17 00:00:00 2001 From: J Alfonso Martinez Date: Thu, 4 Sep 2025 12:46:07 -0600 Subject: [PATCH 3/3] chore: update Node.js setup action to v4 in SonarQube workflow --- .github/workflows/sonar.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 20c571c..f1c63b8 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -14,15 +14,13 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '22' - cache: 'pnpm' - name: Setup pnpm uses: pnpm/action-setup@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 with: - version: 10 + node-version: 22 + cache: 'pnpm' - name: Install deps run: pnpm install - name: Run tests with coverage (LCOV)