|
65 | 65 | cd ${{ env.RESC_FRONTEND_DIR }}
|
66 | 66 | npx auditjs@latest ossi -q || true
|
67 | 67 |
|
| 68 | + - name: Running Jest and Coverage |
| 69 | + run: | |
| 70 | + cd ${{ env.RESC_FRONTEND_DIR }} |
| 71 | + yarn jest --coverage || true |
| 72 | + npm install jest-sonar-reporter --save-dev |
| 73 | + |
| 74 | + ## Removing the dir paths and making them relative paths. |
| 75 | + - name: Fix coverage report |
| 76 | + run: | |
| 77 | + cd ${{ env.RESC_FRONTEND_DIR }} |
| 78 | + sed -i "s+/home/runner/work/repository-scanner/repository-scanner/components/resc-frontend/++g" tests/unit/reports/coverage/lcov.info |
| 79 | + cat tests/unit/reports/coverage/lcov.info |
| 80 | +
|
| 81 | + - name: SonarCloud Scan |
| 82 | + uses: SonarSource/sonarcloud-github-action@master |
| 83 | + with: |
| 84 | + projectBaseDir: ${{ env.RESC_FRONTEND_DIR }} |
| 85 | + args: > |
| 86 | + -Dsonar.organization=abnamro-resc |
| 87 | + -Dsonar.projectKey=abnamro-resc_resc-frontend |
| 88 | + -Dsonar.sourceEncoding=UTF-8 |
| 89 | + -Dsonar.projectName=resc-frontend |
| 90 | + -Dsonar.groupid=resc |
| 91 | + -Dsonar.sources=src/ |
| 92 | + -Dsonar.inclusions=**/* |
| 93 | + -Dsonar.exclusions=**/__mocks__/* |
| 94 | + -Dsonar.tests=tests/ |
| 95 | + -Dsonar.cpd.exclusions=**/*.example.js,**/*.spec.js,**/*.?spec.js |
| 96 | + -Dsonar.coverage.exclusions=**/*.html,**/*.json,**/*.spec.js,**/*.?spec.js,**/main.*,**/i18n.js,**/router/index.js,**/configuration/*.js |
| 97 | + -Dsonar.javascript.jstest.reportsPath=tests/unit/reports/coverage |
| 98 | + -Dsonar.javascript.lcov.reportPaths=tests/unit/reports/coverage/lcov.info |
| 99 | + -Dsonar.pdf.skip=true |
| 100 | + -Dsonar.branch.target=* |
| 101 | + -Dsonar.branch.name=* |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any |
| 104 | + SONAR_TOKEN: ${{ secrets.__SONAR_TOKEN_BACKEND__ }} |
| 105 | + |
68 | 106 | - id: getversion
|
69 | 107 | name: Get package version
|
70 | 108 | run: |
|
|
0 commit comments