From 4c3d9d495be3ef86b75fc3b57354c80272975add Mon Sep 17 00:00:00 2001 From: Ru Chern Chong Date: Mon, 8 Jul 2024 03:32:45 +0800 Subject: [PATCH] Add SonarCloud config --- .github/workflows/{sst.yml => build.yml} | 23 +++++++++++++---------- sonar-project.properties | 4 ++++ 2 files changed, 17 insertions(+), 10 deletions(-) rename .github/workflows/{sst.yml => build.yml} (82%) create mode 100644 sonar-project.properties diff --git a/.github/workflows/sst.yml b/.github/workflows/build.yml similarity index 82% rename from .github/workflows/sst.yml rename to .github/workflows/build.yml index 38fc4b8..4e92f76 100644 --- a/.github/workflows/sst.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,16 @@ -name: SST workflow +name: Build + on: [ push ] concurrency: group: merge-${{ github.ref }} permissions: - id-token: write # This is required for requesting the JWT - contents: read # This is required for actions/checkout + id-token: write + contents: read jobs: - TestAndBuild: + Build: runs-on: ubuntu-latest steps: - name: Checkout @@ -24,18 +25,20 @@ jobs: node-version: 20 cache: 'pnpm' - name: Install dependencies - run: | - pnpm install + run: pnpm install - name: Run tests - run: | - pnpm test + run: pnpm test - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + # - name: SonarCloud Scan + # uses: SonarSource/sonarcloud-github-action@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Run build - run: | - pnpm build + run: pnpm build env: NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..a8d4b30 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=ruchernchong_singapore-motor-trends +sonar.organization=ruchernchong +sonar.javascript.lcov.reportPaths=./coverage/lcov.info +sonar.coverage.exclusions=**/*.test.js,**/*.test.ts,**/*.spec.js,**/*.spec.ts