-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (49 loc) · 1.56 KB
/
coverage.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
name: Comment on PR
# following example: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
on:
workflow_run:
workflows: ["Unit tests"]
types:
- completed
jobs:
report-coverage:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: [self-hosted, linux, x64, gpu]
container:
image: ubuntu
permissions:
# Read the action that triggered this one
actions: read
# Allow to write check runs
checks: write
# Allow for editing existing comments
contents: write
# Allow publishing new comments on PRs
pull-requests: write
# Read and update commit statuses
statuses: write
# Allow to check commit statusses
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id}}
- name: get PR
id: get-pr
run: echo "PR=$(cat coverage.PR)" >> "$GITHUB_OUTPUT"
- name: Get Coverage
uses: 5monkeys/cobertura-action@master
with:
path: coverage.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
pull_request_number: ${{ steps.get-pr.outputs.PR }}
minimum_coverage: 88
show_missing: True
fail_below_threshold: True
link_missing_lines: True
# False for now, might set to true later
only_changed_files: False