Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upload coverage reports as GitHub Actions artifacts #27

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/fullstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*