From 9792096443b453a99e60b9494e861f470acae32c Mon Sep 17 00:00:00 2001 From: Russell Vinegar Date: Mon, 27 Jan 2025 18:33:28 -0800 Subject: [PATCH] reorder code coverage in GHA --- .github/workflows/aps-cypress-e2e.yaml | 50 +++++++++++++------------- gwa-api | 1 + 2 files changed, 27 insertions(+), 24 deletions(-) create mode 160000 gwa-api diff --git a/.github/workflows/aps-cypress-e2e.yaml b/.github/workflows/aps-cypress-e2e.yaml index baf1d289a..9f72ea110 100644 --- a/.github/workflows/aps-cypress-e2e.yaml +++ b/.github/workflows/aps-cypress-e2e.yaml @@ -87,6 +87,32 @@ jobs: name: code-coverage path: ${{ github.workspace }}/e2e/coverage + - name: Instrument the code for coverage analysis + if: always() + run: | + # Rewrite the paths as the coverage starts with '../app'! + sed -e 's/..\/app/./g' ./e2e/coverage/lcov.info > lcov.info + + #cd src + #npm install --legacy-peer-deps + #npx nyc instrument --compact=false . --in-place + + - name: SonarCloud Scan + if: always() + uses: sonarsource/sonarqube-scan-action@master + with: + args: > + -Dsonar.organization=bcgov-oss + -Dsonar.projectKey=aps-portal-e2e + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.projectBaseDir=src + -Dsonar.sources=. + -Dsonar.exclusions=nextapp/**,mocks/**,test/**,tools/**,*.json,*.js + -Dsonar.javascript.lcov.reportPaths=/github/workspace/lcov.info + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Upload Astra scan results uses: actions/upload-artifact@v4 with: @@ -116,30 +142,6 @@ jobs: exit 1 fi - - name: Instrument the code for coverage analysis - run: | - # Rewrite the paths as the coverage starts with '../app'! - sed -e 's/..\/app/./g' ./e2e/coverage/lcov.info > lcov.info - - #cd src - #npm install --legacy-peer-deps - #npx nyc instrument --compact=false . --in-place - - - name: SonarCloud Scan - uses: sonarsource/sonarqube-scan-action@master - with: - args: > - -Dsonar.organization=bcgov-oss - -Dsonar.projectKey=aps-portal-e2e - -Dsonar.host.url=https://sonarcloud.io - -Dsonar.projectBaseDir=src - -Dsonar.sources=. - -Dsonar.exclusions=nextapp/**,mocks/**,test/**,tools/**,*.json,*.js - -Dsonar.javascript.lcov.reportPaths=/github/workspace/lcov.info - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - name: Set up Python 3.9 if: failure() uses: actions/setup-python@v2 diff --git a/gwa-api b/gwa-api new file mode 160000 index 000000000..eed2c5196 --- /dev/null +++ b/gwa-api @@ -0,0 +1 @@ +Subproject commit eed2c5196cbc8b5a3aafe4d549cdd26d4247e947