-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (59 loc) · 1.76 KB
/
workflow.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: build
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
unit-tests:
name: unit-tests
strategy:
matrix:
go-version: [ 1.17.x, 1.18.x ] # support latest 2 major versions
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Download deps
run: go mod download
- name: Test
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
fail_ci_if_error: true
lint:
name: lint
strategy:
matrix:
go-version: [ 1.17.x, 1.18.x ] # support latest 2 major versions
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46
# Optional: working directory, useful for monorepos
# working-directory: somedir
# Optional: golangci-lint command line arguments.
# TODO: switch to .golangci.yml
args: >
--tests=false
-E bodyclose -E golint -E rowserrcheck -E gosec -E interfacer
-E unconvert -E dupl -E goconst -E gocognit -E goimports -E maligned -E unparam
-E dogsled -E prealloc -E gocritic -E wsl -E goprintffuncname
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true