-
Notifications
You must be signed in to change notification settings - Fork 218
48 lines (47 loc) · 1.17 KB
/
ci.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
name: Test & Lint
on:
push:
tags:
- "v*.*.*"
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
name: Prepare cache
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test coverage
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3