From 949223ac8c73eb35912f61087a16fba8047c3ace Mon Sep 17 00:00:00 2001 From: Sean Sylver Date: Mon, 30 Sep 2024 16:24:42 -0700 Subject: [PATCH 1/2] Update sonarscan.yml and sonar-project.properties --- .github/workflows/sonarscan.yml | 7 ++++--- sonar-project.properties | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sonarscan.yml b/.github/workflows/sonarscan.yml index d4dfefc00..001c3ddbd 100644 --- a/.github/workflows/sonarscan.yml +++ b/.github/workflows/sonarscan.yml @@ -7,11 +7,12 @@ on: push: branches: [ main, feature/* ] pull_request_target: + branches: [ main, feature/* ] types: [opened, synchronize, reopened] jobs: sonar: - name: Test - SonarCloud Scan + name: Server - SonarCloud Scan runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -29,10 +30,10 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sonarcloud: - name: SonarCloud + name: Client - SonarCloud Scan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: SonarCloud Scan diff --git a/sonar-project.properties b/sonar-project.properties index a407ebaeb..be978e8dd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.organization=bcgov-sonarcloud sonar.projectKey=bcgov_nr-bcws-wfprev sonar.projectName=wfprev-parent sonar.host.url=https://sonarcloud.io -sonar.sources=. +sonar.sources=client # relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ From 6483f97778298b148628874f30a82d4108772e18 Mon Sep 17 00:00:00 2001 From: Sean Sylver Date: Mon, 30 Sep 2024 16:27:37 -0700 Subject: [PATCH 2/2] Update sonarscan.yml and sonar-project.properties --- .github/workflows/sonarscan.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sonarscan.yml b/.github/workflows/sonarscan.yml index 001c3ddbd..cef9c3db6 100644 --- a/.github/workflows/sonarscan.yml +++ b/.github/workflows/sonarscan.yml @@ -36,6 +36,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install dependencies + run: yarn + - name: Test and coverage + run: yarn jest --coverage - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: