Skip to content

Commit 7f66122

Browse files
authored
[CICD-844] Add SonarQube config and workflow (#114)
Add SonarQube config and workflow
1 parent 68a4d68 commit 7f66122

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/sonar.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
# Trigger analysis for pushes and pull requests
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
9+
name: SonarQube
10+
jobs:
11+
domino_quality_gate:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
# Fetch full history for better SCM information
18+
fetch-depth: 0
19+
20+
- name: Run SonarQube Scan
21+
uses: sonarsource/sonarqube-scan-action@master
22+
env:
23+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
24+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
25+
26+
- name: Quality Gate Check
27+
uses: sonarsource/sonarqube-quality-gate-action@master
28+
timeout-minutes: 5
29+
env:
30+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

sonar-project.properties

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Server and project configuration
2+
sonar.projectVersion=1.0-beta
3+
sonar.sourceEncoding=UTF-8
4+
sonar.scm.provider=git
5+
6+
# Project identifiers
7+
sonar.projectName=github-action-wpe-site-deploy
8+
sonar.projectKey=wpengine_github-action-wpe-site-deploy_2cd09997-922e-4fc9-b1ba-46178d41a6ce
9+
10+
# Individual configurations
11+
# Paths to source code directories (use relative paths)
12+
sonar.sources=.
13+
14+
# # Additional parameters for advanced configurations
15+
# sonar.exclusions=**/docs/**, **/tests/**, **/node_modules/**

0 commit comments

Comments
 (0)