-
Notifications
You must be signed in to change notification settings - Fork 36
61 lines (54 loc) · 2.43 KB
/
coverage-base-update.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Update coverage comment # base-update.yml
on:
pull_request:
types: [edited]
permissions:
# allow dependabot to execute this workflow
pull-requests: write
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: Test and report
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1000
- name: Prepare for Report Coverage (without nyc run)
run: |
npm i svelte-to-html@1.0.9
git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
- name: Download artifact for base branch
uses: dawidd6/action-download-artifact@v6
continue-on-error: true
with:
workflow: ${{ github.event.pull_request.base.ref == 'main' && 'coverage-main-branch.yml' || github.event.pull_request.base.ref == 'develop' && 'coverage-develop-branch.yml' || 'coverage.yml' }}
workflow_conclusion: success
commit: ${{github.event.pull_request.base.sha}}
name: 'test-coverage-output'
path: base-artifacts
search_artifacts: true
- name: Download artifact for to be merged branch
uses: dawidd6/action-download-artifact@v6
continue-on-error: true
with:
workflow: 'coverage.yml'
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: 'test-coverage-output'
path: artifacts
search_artifacts: true
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: 'base-artifacts/coverage-summary.json, artifacts/coverage-summary.json'
- name: Update Coverage comment
uses: sidx1024/report-nyc-coverage-github-action@v1.2.7
if: steps.check_files.outputs.files_exists == 'true'
# Only runs if all of the files exists
with:
coverage_file: 'artifacts/coverage-summary.json'
base_coverage_file: 'base-artifacts/coverage-summary.json'
comment_template_file: '.coverage-comment-template.svelte'