Skip to content

Commit

Permalink
chore: sonar configuration (#88)
Browse files Browse the repository at this point in the history
* ci: coverage for sonar and exclusions

* ci: fix sonar conf
  • Loading branch information
SimonDmz authored Dec 7, 2023
1 parent 4e87f82 commit 4e5b405
Show file tree
Hide file tree
Showing 8 changed files with 630 additions and 312 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 14
- name: install
run: yarn --frozen-lockfile
- name: test & coverage
run: yarn run test
- name: SonarCloud scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/build.yml

This file was deleted.

26 changes: 0 additions & 26 deletions azure-pipelines.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sonor",
"version": "0.5.20",
"version": "0.5.21",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
Expand Down Expand Up @@ -34,7 +34,7 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"cypress:test": "start-server-and-test start http://localhost:3000 cypress:run",
"test": "react-scripts test",
"test": "react-scripts test --coverage .",
"build": "react-scripts build && copy-and-watch configuration/configuration.json build"
},
"browserslist": {
Expand Down
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Sonar keys
sonar.projectKey=InseeFr_Sonor
sonar.organization=inseefr

# exclude tests files for code duplication evaluation
sonar.sources = src/
sonar.exclusions = src/tests/**/*,src/components/**/__snapshots__/*
sonar.javascript.lcov.reportPaths = coverage/lcov.info
Loading

0 comments on commit 4e5b405

Please sign in to comment.