-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
49 lines (43 loc) · 1.33 KB
/
action.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
name: Generate badges
description: To generate code coverage badges
inputs:
app-name:
description: Name of the App
required: true
environment:
description: Environment this action runs on
required: false
artifact:
description: Name of artifact
required: false
default: "xml-reports"
outputs:
BADGES: # id of output
description: "Code coverage badge"
value: ${{ steps.badge.outputs.BADGE }}
runs:
using: "composite"
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Download xml reports
uses: actions/[email protected]
with:
name: ${{ inputs.artifact }}
# generates a .md file with code coverage link
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '30 80'
- name: Get badge from .md
id: badge
run: echo "BADGE=$(grep -oP '!\[Code Coverage\]\(https:\/\/img\.shields\.io\/badge\/Code%20Coverage-[^)]+\)' code-coverage-results.md | awk -F'[()]' '{print $2}')" >> $GITHUB_OUTPUT
shell: bash