From c15d124c79a6bb1ed72989ad03471aad3f31a79f Mon Sep 17 00:00:00 2001 From: samwisekind Date: Tue, 24 Dec 2024 01:27:31 +0000 Subject: [PATCH 1/3] Add code coverage tracking --- .github/workflows/main.yaml | 6 ++++++ .sonarcloud.properties => sonar-project.properties | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) rename .sonarcloud.properties => sonar-project.properties (51%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1961821..e0f74d8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -37,6 +37,12 @@ jobs: - name: Test unit run: npm run test:unit + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + test-terraform: runs-on: ubuntu-latest diff --git a/.sonarcloud.properties b/sonar-project.properties similarity index 51% rename from .sonarcloud.properties rename to sonar-project.properties index f2a5e6f..5cbf887 100644 --- a/.sonarcloud.properties +++ b/sonar-project.properties @@ -1,3 +1,6 @@ -sonar.sources=. +sonar.projectKey=CRRU-UK_website +sonar.sources=. +sonar.javascript.lcov.reportPaths=./coverage/lcov.info sonar.cpd.exclusions=**/*.spec.ts,**/*.spec.tsx,src/helpers/types.ts,src/helpers/constants.ts,src/pages/**/* +sonar.javascript.lcov.reportPaths \ No newline at end of file From 71d696b66f31776ffba8fedfa7faacfe292b601e Mon Sep 17 00:00:00 2001 From: samwisekind Date: Tue, 24 Dec 2024 01:28:44 +0000 Subject: [PATCH 2/3] Updates --- README.md | 1 + sonar-project.properties | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0366baf..bbbbe41 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=CRRU-UK_website&metric=bugs)](https://sonarcloud.io/summary/new_code?id=CRRU-UK_website) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=CRRU-UK_website&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=CRRU-UK_website) [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=CRRU-UK_website&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=CRRU-UK_website) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=CRRU-UK_website&metric=coverage)](https://sonarcloud.io/summary/new_code?id=CRRU-UK_website) 1. [Introduction](#introduction) 2. [Overview](#overview) diff --git a/sonar-project.properties b/sonar-project.properties index 5cbf887..773cba4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,4 +3,3 @@ sonar.projectKey=CRRU-UK_website sonar.sources=. sonar.javascript.lcov.reportPaths=./coverage/lcov.info sonar.cpd.exclusions=**/*.spec.ts,**/*.spec.tsx,src/helpers/types.ts,src/helpers/constants.ts,src/pages/**/* -sonar.javascript.lcov.reportPaths \ No newline at end of file From fcaa2649387a364f1c3f27a946233ba6452ae5f3 Mon Sep 17 00:00:00 2001 From: samwisekind Date: Tue, 24 Dec 2024 01:30:10 +0000 Subject: [PATCH 3/3] Update --- .github/workflows/main.yaml | 2 +- sonar-project.properties | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e0f74d8..228a55a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -58,5 +58,5 @@ jobs: with: terraform_version: 1.10.3 - - name: Terraform fmt + - name: Test formatting run: terraform fmt -list=true -check -recursive -diff diff --git a/sonar-project.properties b/sonar-project.properties index 773cba4..1a529fd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,7 @@ sonar.projectKey=CRRU-UK_website +sonar.organization=crru sonar.sources=. + sonar.javascript.lcov.reportPaths=./coverage/lcov.info sonar.cpd.exclusions=**/*.spec.ts,**/*.spec.tsx,src/helpers/types.ts,src/helpers/constants.ts,src/pages/**/*