diff --git a/.github/workflows/fullstack.yml b/.github/workflows/fullstack.yml index 10319ec..2310b48 100644 --- a/.github/workflows/fullstack.yml +++ b/.github/workflows/fullstack.yml @@ -9,8 +9,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Install Node.js uses: actions/setup-node@v4 @@ -50,9 +48,21 @@ jobs: - name: Run shared unit tests run: pnpm --filter shared test:cov + - name: Upload shared unit test coverage report + uses: actions/upload-artifact@v4 + with: + name: shared-unit-coverage-report + path: ./coverage/shared/lcov.info + - name: Run api unit tests run: pnpm --filter api test:cov + - name: Upload api unit test coverage report + uses: actions/upload-artifact@v4 + with: + name: api-unit-coverage-report + path: ./coverage/api/lcov.info + - name: Run api e2e tests env: DATABASE_TYPE: sqlite @@ -64,6 +74,25 @@ jobs: AUTH0_CLIENT_SECRET: ${{ secrets.TEST_AUTH0_CLIENT_SECRET }} run: pnpm --filter api test-e2e:cov + - name: Upload api end-to-end test coverage report + uses: actions/upload-artifact@v4 + with: + name: api-e2e-coverage-report + path: ./coverage/api-e2e/lcov.info + + sonarcloud: + name: SonarCloud Analysis + runs-on: ubuntu-latest + needs: tests + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download artifacts + uses: actions/download-artifact@v4 + - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: diff --git a/sonar-project.properties b/sonar-project.properties index a288a22..6a89744 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.projectKey=MuNuChapterHKN_HKrecruitment sonar.organization=munuchapterhkn sonar.projectName=HKrecruitment -sonar.javascript.lcov.reportPaths=./coverage/shared/lcov.info, ./coverage/api/lcov.info, ./coverage/api-e2e/lcov.info +sonar.javascript.lcov.reportPaths=./shared-unit-coverage-report/lcov.info, ./api-unit-coverage-report/lcov.info, ./api-e2e-coverage-report/lcov.info sonar.sources=api/, frontend/, shared/ sonar.coverage.exclusions=**/node_modules/**/*, **/*.spec.*, **/*.e2e-spec.*, **/documentation/**/*, **/frontend/**/*, **/test/**/*, **/tests/**/*, **/*.json, **/*.yaml, **/*.yml, **/*.md, **/mocks/**/* sonar.cpd.exclusions=**/mocks/**/* \ No newline at end of file