-
Notifications
You must be signed in to change notification settings - Fork 20
36 lines (36 loc) · 1.09 KB
/
test.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
name: test
on: [push]
permissions:
contents: write
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic
- name: check test coverage
id: coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
#local-prefix: github.com/org/project
threshold-file: 80
threshold-package: 80
threshold-total: 95
- name: make coverage badge
uses: action-badges/core@0.2.2
if: contains(fromJSON('["refs/heads/master", "refs/heads/main"]'), github.ref)
with:
label: coverage
message: ${{ steps.coverage.outputs.badge-text }}
message-color: ${{ steps.coverage.outputs.badge-color }}
file-name: coverage.svg
badge-branch: badges
github-token: "${{ secrets.GITHUB_TOKEN }}"