From 4b3e6edf08d034efc8d3610788246cee1650ae5e Mon Sep 17 00:00:00 2001 From: Kirill Gavrilov Date: Tue, 21 Jan 2025 23:37:35 +0300 Subject: [PATCH] ci: configure SonarQube --- .github/workflows/ci.yml | 17 +++++++++++++++++ sonar-project.properties | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 sonar-project.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5054ffe..8d80d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,20 @@ jobs: with: name: lcov.info path: out/coverage/lcov.info + + SonarScan: + needs: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Download coverage data + uses: actions/download-artifact@v4 + with: + name: lcov.info + path: coverage/ + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v4 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..8d8502c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,9 @@ +sonar.projectKey=gavvvr_obsidian-imgur-plugin +sonar.organization=gavvvr + +sonar.sources=src +sonar.exclusions=**/*.test.ts +sonar.tests=src +sonar.test.inclusions=**/*.test.ts + +sonar.javascript.lcov.reportPaths=./coverage/lcov.info