Skip to content

Commit

Permalink
test(designer): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hartra344 committed May 7, 2024
1 parent 696d2ea commit 3becf36
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/base-coverage.yml
Expand Up @@ -23,6 +23,11 @@ jobs:
with:
node-version: 20.x

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
cache: true

- uses: pnpm/action-setup@v3
with:
version: 8
Expand All @@ -31,8 +36,14 @@ jobs:
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm turbo run test:lib --cache-dir=.turbo
- run: npx cobertura-merge-globby -o coverage.xml --files="**/cobertura-coverage.xml"
- name: Create code coverage report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:"libs/*/coverage/cobertura-coverage.xml" -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub,Cobertura'
- uses: clearlyip/code-coverage-report-action@v4
with:
#Location of the generated coverage file
filename: 'coverage.xml'
filename: 'CodeCoverage/Cobertura.xml'
- name: Write to Job Summary
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
15 changes: 13 additions & 2 deletions .github/workflows/coverage-report.yml
Expand Up @@ -24,6 +24,10 @@ jobs:
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
cache: true

- name: Set up Node.js
uses: actions/setup-node@v1
Expand All @@ -38,17 +42,24 @@ jobs:
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm turbo run test:lib --cache-dir=.turbo -- --changed origin/main
- run: npx cobertura-merge-globby -o coverage.xml --files="**/cobertura-coverage.xml"
- name: Create code coverage report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:"libs/*/coverage/cobertura-coverage.xml" -targetdir:CodeCoverage -reporttypes:'MarkdownSummaryGithub,Cobertura'
- name: Generate Coverage Report
uses: clearlyip/code-coverage-report-action@v4
id: code_coverage_report_action
with:
#Location of the generate coverage file
filename: 'coverage.xml'
filename: 'CodeCoverage/Cobertura.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
badge: true
fail_on_negative_difference: true
artifact_download_workflow_names: 'base-coverage'

- name: Write to Job Summary
run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Add Coverage PR Comment
#Make sure the report was generated and that the event is actually a pull request, run if failed or success
uses: marocchino/sticky-pull-request-comment@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -10,7 +10,7 @@ build
.nx
# dependencies
node_modules

/CodeCoverage
# IDEs and editors
/.idea
.project
Expand Down

0 comments on commit 3becf36

Please sign in to comment.