-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 966 Bytes
/
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
37
38
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Format
run: gofmt -s -w . && git diff --exit-code
- name: Tidy
run: go mod tidy && git diff --exit-code
- name: Test
run: |
mkdir -p "${{ runner.temp }}/covdata"
go test -v -cover ./... -test.gocoverdir="${{ runner.temp }}/covdata"
go tool covdata percent -i="${{ runner.temp }}/covdata"
go tool covdata textfmt -o "${{ runner.temp }}/coverage.out" -i="${{ runner.temp }}/covdata"
- name: Coverage report
uses: ncruces/go-coverage-report@v0
with:
coverage-file: "${{ runner.temp }}/coverage.out"
report: true
chart: true
amend: true
if: |
github.event_name == 'push'
continue-on-error: true