Skip to content

Commit

Permalink
Add Coverage Reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
wahln committed Apr 22, 2024
1 parent 372e09f commit 2d1dd0f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/actions/test-matlab/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ runs:
name: Test Results (Matlab ${{ inputs.matlab-version }})
path: |
matRad/testresults.xml
matRad/coverage.xml
- name: Publish Test Results
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Coverage Report

permissions:
checks: write
pull-requests: write

on:
workflow_run:
workflows: ["Tests"]
types:
- completed

jobs:
download_and_report:
runs-on: ubuntu-latest

steps:

# Step to download artifact from a previous workflow run 1
- name: Download Artifact 1
uses: actions/download-artifact@v3
with:
name: Test Results (Matlab R2022b) # Replace with your actual artifact name
path: coverage

- name: Publish Test Results
uses: irongut/[email protected]
with:
filename: coverage/coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '40 70'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
19 changes: 5 additions & 14 deletions .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Results
name: Test Report

permissions:
checks: write
Expand Down Expand Up @@ -37,20 +37,11 @@ permissions:
name: Test Results (Octave) # Replace with your actual artifact name
path: test-results/artifact3

# Step to use an action to report the test results on GitHub
- name: Report Test Results
uses: some-org/some-test-report-action@v1 # Replace with your specific action
with:
result-files: |
test-results/artifact1/testresults.xml
test-results/artifact2/testresults.xml
test-results/artifact3/testresults.xml
# other required inputs for the action


- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
test-results/*/*.xml
check_name: "Test Results"
test-results/*/testresults.xml
check_name: "Test Results"


0 comments on commit 2d1dd0f

Please sign in to comment.