Skip to content

Commit 9a042cb

Browse files
Merge pull request #348 from zowe/SonarQubeInt
Create SonarQube.yml
2 parents 4be60f3 + cfc277f commit 9a042cb

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/SonarQube.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: SonarQube Quality Check
2+
3+
on:
4+
push:
5+
branches: [ "v3.x/staging" ]
6+
pull_request:
7+
branches: [ "v3.x/staging" ]
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
11+
jobs:
12+
analyze-pr:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
defaults:
18+
run:
19+
working-directory: ./
20+
21+
steps:
22+
- name: Checkout PR head with limited history
23+
uses: actions/checkout@v4
24+
with:
25+
ref: v3.x/staging
26+
27+
- name: Use Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "20"
31+
32+
- name: Install npm
33+
run: npm install
34+
35+
- name: Test with coverage (Jest)
36+
run: npm test --if-present -- --coverage
37+
env:
38+
CI: true
39+
40+
- name: SonarQube Scan
41+
continue-on-error: false
42+
uses: sonarsource/sonarqube-scan-action@v5
43+
env:
44+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
45+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
46+
with:
47+
args: >
48+
-Dsonar.projectKey=zowe_zlux-app-server
49+
-Dsonar.organization=zowe
50+
-Dsonar.branch.name=${{ github.ref_name }}
51+
-Dsonar.sources=bin,defaults,lib
52+
-Dsonar.test.inclusions=**/*.sh,**/*.js,**/*.json
53+
-Dsonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/*.d.ts
54+
-Dsonar.javascript.lcov.reportPaths=webClient/coverage/lcov.info
55+
-Dsonar.qualitygate.wait=true
56+
-Dsonar.qualitygate.timeout=600

0 commit comments

Comments
 (0)