Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: SonarCloud Scan

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
sonarcloud:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Install Node.js
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.15.1'

# Install dependencies
- run: npm install

# Run tests with coverage
- run: npm run test:coverage

# Run SonarScanner
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectKey=<your_sonarcloud_project_key>
-Dsonar.organization=<your_organization_key>
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dist-ssr
*.sln
*.sw?

*storybook.log
*storybook.log
coverage
215 changes: 200 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^2.1.2",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
Expand Down
14 changes: 14 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sonar.projectKey=zjefersound_react-essentials
sonar.organization=zjefersound

# Project sources
sonar.sources=src
sonar.exclusions=node_modules/**,dist/**,coverage/**,*.config.js

# Tests & Coverage
sonar.tests=src
sonar.test.inclusions=src/**/*.spec.ts,src/**/*.test.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info

# Set the encoding of your source files
sonar.sourceEncoding=UTF-8
Loading