Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add sonar analysis in the CI #97

Merged
merged 1 commit into from
Sep 18, 2024
Merged
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
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ module.exports = {
rules: {
'prettier/prettier': 'warn',
},
ignorePatterns: [
'coverage',
]
};
1 change: 1 addition & 0 deletions .github/config/.licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ header:
- '**/*.svg'
- '**/*.css'
- '**/*.conf'
- '**/*.properties'

comment: on-failure
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: CI
on: [push]
on:
push:
branches:
- 'main'
pull_request:

jobs:
license-headers:
Expand All @@ -24,6 +28,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: FixForNodeWarnings
Expand All @@ -35,5 +40,11 @@ jobs:
npm install
npm run licenses-check
npm run lint
npm run test
npm run test:coverage
npm run build

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"build": "vite build",
"prepublishOnly": "$npm_execpath run build",
"test": "jest",
"test:coverage": "jest --coverage",
"start": "vite demo/ --config vite.config.ts --open",
"lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0",
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
Expand Down
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.projectKey=powsybl_powsybl-diagram-viewer
sonar.organization=powsybl-ci-github
sonar.projectBaseDir=src
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
Loading