|
| 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