diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a202a71bd7..1589ef6a29 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -75,13 +75,21 @@ jobs: # Configuration to run a SonarCloud analysis on main, release and next branches sonarcloud: - name: SonarCloud + name: SonarCloud Analysis runs-on: ubuntu-latest + needs: build steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v3 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan + name: coverage-artifacts + path: coverage + + - name: Run sonar cloud analysis uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a79bb2ccb9..4d5f106e03 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -43,13 +43,21 @@ jobs: # Configuration to run a SonarCloud analysis on main branch sonarcloud: - name: SonarCloud + name: SonarCloud Analysis runs-on: ubuntu-latest + needs: build steps: - - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan + fetch-depth: 0 + + - uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: coverage + + - name: Run sonar cloud analysis uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any diff --git a/sonar-project.properties b/sonar-project.properties index fe5de5f318..d024bc0c0c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,7 +6,7 @@ sonar.host.url=https://sonarcloud.io sonar.sources=packages sonar.test.inclusions=packages/**/*.tests.ts -sonar.exclusions=node_modules, samples +sonar.exclusions=node_modules sonar.sourceEncoding=UTF-8 -sonar.typescript.lcov.reportPaths=coverage/lcov.info \ No newline at end of file +sonar.javascript.lcov.reportPaths=coverage/lcov.info \ No newline at end of file