Skip to content

fix(sonar): Fix test path overlap causing double indexing #41

fix(sonar): Fix test path overlap causing double indexing

fix(sonar): Fix test path overlap causing double indexing #41

Workflow file for this run

name: SonarCloud Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: |
backend/package-lock.json
frontend/package-lock.json
- name: Install Backend Dependencies
working-directory: ./backend
run: npm ci
continue-on-error: true
- name: Install Frontend Dependencies
working-directory: ./frontend
run: npm ci
continue-on-error: true
- name: Run Backend Tests with Coverage
working-directory: ./backend
run: npm run test:coverage || echo "Backend tests completed"
env:
NODE_ENV: test
MONGODB_URI: mongodb://localhost:27017/notes-app-test
JWT_SECRET: test-jwt-secret-for-ci
continue-on-error: true
- name: Run Frontend Tests with Coverage
working-directory: ./frontend
run: npm run test:coverage || echo "Frontend tests completed"
continue-on-error: true
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}