From b038ae4953e99f2f48aecda018d4e3e497811457 Mon Sep 17 00:00:00 2001 From: Louis Grasset Date: Mon, 23 Oct 2023 02:39:13 +0200 Subject: [PATCH] ci(sonar): support code coverage --- .github/workflows/ci.yml | 15 +++++++++++++-- .github/workflows/codeql.yml | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f76227..028880e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,19 @@ jobs: - name: Install dependencies (with dev) run: npm ci --include=dev - - name: Run tests - run: npm run test + - name: Run test and coverage + run: npm run test -- --coverage + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + with: + args: > + -Dsonar.organization=my-louisgrasset + -Dsonar.projectKey=my-louisgrasset_touitomamout + -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info commitlint: name: "Commitlint Validation" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e93b799..cb9a67c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL