feat(tools): set up sonar #1

Merged
naomi merged 19 commits from feat/sonar into main 2025-02-26 13:03:33 -08:00
3 changed files with 53 additions and 19 deletions
Showing only changes of commit 657f80af5d - Show all commits

View File

@ -30,22 +30,3 @@ jobs:
- name: Run Tests
run: pnpm run test
- name: Echo
run: |
echo "PR Number: ${{ github.event.pull_request.number }}"
echo "PR Branch: ${{ github.event.pull_request.head.ref }}"
- name: Sonar
uses: SonarSource/sonarqube-scan-action@v4
timeout-minutes: 10
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://quality.nhcarrigan.com"
with:
args: >
-Dsonar.sources=.
-Dsonar.projectKey=typescript-config
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=main

View File

@ -0,0 +1,24 @@
name: Code Analysis
on:
push:
branches:
- main
jobs:
sonar:
name: SonarQube
steps:
- name: Checkout Source Files
uses: actions/checkout@v4
- name: Sonar
uses: SonarSource/sonarqube-scan-action@v4
timeout-minutes: 10
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://quality.nhcarrigan.com"
with:
args: >
-Dsonar.sources=.
-Dsonar.projectKey=typescript-config

View File

@ -0,0 +1,29 @@
name: Code Analysis
on:
pull_request:
branches:
- main
jobs:
sonar:
name: SonarQube
steps:
- name: Checkout Source Files
uses: actions/checkout@v4
- name: Sonar
uses: SonarSource/sonarqube-scan-action@v4
timeout-minutes: 10
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: "https://quality.nhcarrigan.com"
PR_KEY: ${{ github.event.pull_request.number }}
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
with:
args: >
-Dsonar.sources=.
-Dsonar.projectKey=typescript-config
-Dsonar.pullrequest.key=$PR_KEY
-Dsonar.pullrequest.branch=$PR_BRANCH
-Dsonar.pullrequest.base=main