-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.09 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
name: Test Coverage
run-name: Test Coverage
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: Install libwebp
run: sudo apt-get install libwebp-dev
- name: Generate Test Coverage
run: go test ./... -coverprofile=./cover.out
- name: Check Test Coverage
id: coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
- name: Make Coverage Badge
uses: action-badges/[email protected]
if: contains(github.ref, 'master')
with:
label: coverage
message: ${{ steps.coverage.outputs.badge-text }}
message-color: ${{ steps.coverage.outputs.badge-color }}
file-name: coverage.svg
badge-branch: badges ## orphan branch where badge will be committed
github-token: "${{ secrets.GH_PAT }}"