Skip to content

Commit

Permalink
Merge pull request #254 from vivid-planet/sonar-qube-actions
Browse files Browse the repository at this point in the history
Invoke SonarQube via GitHub action
  • Loading branch information
kaufmo authored Dec 19, 2024
2 parents cb721e4 + edec02c commit 1385c23
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/sonar-qube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: SonarCloud Code Analysis

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
- next

jobs:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
cache: "pnpm" # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies

- run: pnpm install --frozen-lockfile

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.projectKey=vivid-planet_comet-brevo-module
sonar.organization=vivid-planet
sonar.sources=demo/,packages/
sonar.tests=packages/
sonar.test.inclusions=packages/**/__tests__/**,packages/**/*.spec.ts
sonar.exclusions=packages/**/__tests__/**,packages/**/*.spec.ts
sonar.cpd.exclusions=packages/**/__tests__/**,packages/**/*.spec.ts
sonar.typescript.tsconfigPaths=demo/*/tsconfig.json,packages/*/tsconfig.json

0 comments on commit 1385c23

Please sign in to comment.