From 0c6318c6556ac2f0b2fa4ad9d3b8ec494a5ad537 Mon Sep 17 00:00:00 2001 From: mathuo Date: Sun, 28 Mar 2021 20:39:01 +0100 Subject: [PATCH] chore: enable test coverage for sonar --- .github/workflows/main.yml | 10 +++++++++- .github/workflows/sonarcloud-analysis.yml | 20 -------------------- packages/dockview/jest.config.js | 2 +- sonar-project.properties | 2 ++ 4 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/sonarcloud-analysis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b472c87c1..53d30fca0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: "12.x" - uses: actions/cache@v2 with: @@ -29,3 +29,11 @@ jobs: env: CI: true CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - 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 }} diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml deleted file mode 100644 index 43d835039..000000000 --- a/.github/workflows/sonarcloud-analysis.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened] -jobs: - sonarcloud: - name: SonarCloud - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - 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 }} \ No newline at end of file diff --git a/packages/dockview/jest.config.js b/packages/dockview/jest.config.js index bf66cad4c..c00927710 100644 --- a/packages/dockview/jest.config.js +++ b/packages/dockview/jest.config.js @@ -20,5 +20,5 @@ module.exports = { modulePathIgnorePatterns: [ '/packages/dockview/src/__tests__/__mocks__', ], - coverageDirectory: 'coverage', + coverageDirectory: '/packages/dockview/coverage/', }; diff --git a/sonar-project.properties b/sonar-project.properties index c4f3f5526..5808cf567 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,3 +12,5 @@ sonar.inclusions=packages/dockview/**/* # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 + +sonar.javascript.lcov.reportPaths=packages/dockview/coverage/lcov.info