-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (36 loc) · 1.1 KB
/
Copy pathcoverage.yaml
File metadata and controls
36 lines (36 loc) · 1.1 KB
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
name: coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions: {}
jobs:
coverage:
permissions:
contents: read
code-quality: write
pull-requests: read # not sure if this is required
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: stable
- name: Calculate coverage
run: |
go test -count=1 -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./...
- name: Convert Go coverage profile to cobertuba format
run: |
go install github.com/boumenot/gocover-cobertura@v1.5.0
gocover-cobertura < cover.out > cover.xml
- name: Upload coverage to GitHub API
uses: actions/upload-code-coverage@1c15be36fc3733ba839b1dd643bd9556e4426dc1 # v1.4.1
with:
file: cover.xml
language: Go
label: code-coverage/go-test
# feature only available for team and enterprise accounts
fail-on-error: false