-
Notifications
You must be signed in to change notification settings - Fork 52
57 lines (50 loc) · 1.21 KB
/
unit-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Lint & Unit Test
on:
push:
branches:
- master
- main
paths:
- '**.go'
pull_request:
paths:
- '**.go'
permissions:
contents: read
jobs:
lint:
name: golangci-lint
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.15
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.47.3
unit-test:
strategy:
matrix:
go: [1.15]
name: unit-test
needs: [lint]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Set Prefix
id: prefix
run: |
echo "PREFIX=$(go list -m)" >> $GITHUB_OUTPUT
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: e47aa5e6270db938ee1bdd6dc9486f4f581beb1bcaee5d28be1633d68c8550c6
with:
coverageLocations: |
${{github.workspace}}/coverage.out:gocov
coverageCommand: go test -v -coverprofile=coverage.out ./...
prefix: ${{ steps.prefix.outputs.PREFIX }}