From d37fbc0fa0c8b91398adf397ebfb1368cc4aac8b Mon Sep 17 00:00:00 2001 From: RamkrishnaRocket1 Date: Mon, 15 Sep 2025 13:58:33 +0530 Subject: [PATCH 1/2] Create SonarQube.yml Signed-off-by: RamkrishnaRocket1 --- .github/workflows/SonarQube.yml | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/SonarQube.yml diff --git a/.github/workflows/SonarQube.yml b/.github/workflows/SonarQube.yml new file mode 100644 index 0000000..7fa91af --- /dev/null +++ b/.github/workflows/SonarQube.yml @@ -0,0 +1,56 @@ +name: SonarQube Quality Check + +on: + push: + branches: [ "v3.x/staging" ] + pull_request: + branches: [ "v3.x/staging" ] + types: [opened, synchronize, reopened, ready_for_review] + + +jobs: + analyze-pr: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + defaults: + run: + working-directory: webClient + + steps: + - name: Checkout PR head with limited history + uses: actions/checkout@v4 + with: + ref: v3.x/staging + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install npm + run: npm install + + - name: Test with coverage (Jest) + run: npm test --if-present -- --coverage + env: + CI: true + + - name: SonarQube Scan + continue-on-error: false + uses: sonarsource/sonarqube-scan-action@v5 + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.projectKey=zowe_sample-angular-app + -Dsonar.organization=zowe + -Dsonar.sources=webClient + -Dsonar.tests=webClient/src/app + -Dsonar.test.inclusions=**/*.(spec|test).ts,**/*.(spec|test).tsx,**/*.(spec|test).js,**/*.(spec|test).jsx + -Dsonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/*.d.ts + -Dsonar.javascript.lcov.reportPaths=webClient/coverage/lcov.info + -Dsonar.qualitygate.wait=true + -Dsonar.qualitygate.timeout=600 From a2181a3ccdbc83134d5a67596eaf9464d991aaae Mon Sep 17 00:00:00 2001 From: RamkrishnaRocket1 Date: Mon, 22 Sep 2025 20:22:28 +0530 Subject: [PATCH 2/2] Update SonarQube.yml Signed-off-by: RamkrishnaRocket1 --- .github/workflows/SonarQube.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SonarQube.yml b/.github/workflows/SonarQube.yml index 7fa91af..0189d5e 100644 --- a/.github/workflows/SonarQube.yml +++ b/.github/workflows/SonarQube.yml @@ -47,7 +47,7 @@ jobs: args: > -Dsonar.projectKey=zowe_sample-angular-app -Dsonar.organization=zowe - -Dsonar.sources=webClient + -Dsonar.sources=webClient,nodeServer,zssServer -Dsonar.tests=webClient/src/app -Dsonar.test.inclusions=**/*.(spec|test).ts,**/*.(spec|test).tsx,**/*.(spec|test).js,**/*.(spec|test).jsx -Dsonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/*.d.ts