-
Notifications
You must be signed in to change notification settings - Fork 8
37 lines (28 loc) · 1 KB
/
lint-and-test.yaml
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
name: Lint & Test
on:
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version-file: 'go.mod'
- name: Run the linters
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # tag=v3.2.0
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Set up Go
uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # tag=v3
with:
go-version-file: 'go.mod'
- name: Run the tests and generate the coverage profile
run: go test ./... --coverprofile=cover.out
- name: Install gocovergate
run: go install github.com/patrickhoefler/gocovergate@latest
- name: Check the code coverage
run: gocovergate