-
Notifications
You must be signed in to change notification settings - Fork 10
/
action.yml
61 lines (56 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
61
name: Go coverage report
description: This action updates adds an HTML coverage report and SVG badge to your wiki.
branding:
color: blue
icon: award
inputs:
coverage-file:
description: Coverage input file. By default, generate coverage for all packages in the current module.
output-dir:
description: Custom output directory for the badge, report, chart, etc. By default, the wiki's root directory.
badge-style:
description: Badge style generated by shields.io (one of flat, flat-square, plastic, for-the-badge, social).
default: flat
badge-title:
description: Badge title generated by shields.io.
default: coverage
report:
description: Generate an HTML coverage report.
default: true
chart:
description: Generate a coverage over time chart.
default: false
amend:
description: Amend wiki, avoiding spurious commits.
default: false
reuse-go:
deprecationMessage: Go install is always reused.
runs:
using: composite
steps:
- name: Checkout code
uses: actions/checkout@v4
if: |
hashFiles('.github') == '' &&
inputs.coverage-file == ''
- name: Checkout wiki
uses: actions/checkout@v4
with:
repository: ${{github.repository}}.wiki
path: ./.github/wiki/
- name: Generate coverage report
shell: bash
env:
INPUT_COVERAGE: ${{inputs.coverage-file}}
INPUT_REPORT: ${{inputs.report}}
INPUT_CHART: ${{inputs.chart}}
INPUT_BADGE_STYLE: ${{inputs.badge-style}}
INPUT_BADGE_TITLE: ${{inputs.badge-title}}
run: |
${{github.action_path}}/coverage.sh ./.github/wiki/${{inputs.output-dir}}
- name: Push to wiki
shell: bash
env:
INPUT_AMEND: ${{inputs.amend}}
run: |
${{github.action_path}}/push.sh ./.github/wiki/