-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (53 loc) · 1.47 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
on:
push:
branches:
- "**"
- "!main"
name: CI
jobs:
quality:
name: Quality
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Go cache
id: cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
~/Library/Caches/go-build
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ matrix.os }}-go-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
go install github.com/mfridman/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Dependency linter
if: matrix.os == 'ubuntu-latest'
run: |
go mod tidy -compat=1.19
git add .
git diff --cached --exit-code
- name: Build
run: go build .
- name: Test
run: |
go test -race -cover -covermode=atomic -json | tparse -all -dump -smallscreen
go test -race -bench .
- name: Go golangci-lint
if: matrix.os == 'ubuntu-latest'
run: golangci-lint run -c misc/golangci/config.yml ./...