-
-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (35 loc) · 1.18 KB
/
coverage-report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Report Coverage
on:
workflow_run:
workflows: ["Test"]
types:
- completed
jobs:
report:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Sanitize branch name
id: sanitize_branch
run: |
# Replace invalid characters with a dash '-'
SANITIZED_BRANCH=$(echo "${{ github.head_ref }}" | sed 's/[\/\\:*?"<>|]/-/g')
echo "SANITIZED_BRANCH=$SANITIZED_BRANCH" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
name: coverage-${{ env.SANITIZED_BRANCH }} # github.event.workflow_run.head_branch
path: coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- uses: actions/download-artifact@v4
with:
name: coverage-main
path: coverage-main
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Report Coverage"
uses: davelosert/vitest-coverage-report-action@v2
with:
json-summary-compare-path: coverage-main/coverage-summary.json