forked from hyperledger-labs/go-perun
-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (79 loc) · 2.03 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI
on:
push:
branches: [main]
pull_request:
release:
env:
go-version: 1.17
jobs:
check-copyright:
name: Copyright
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Authors
run: .scripts/check-notice-authors.sh origin/main
vet:
name: Vetting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check vanity import
run: .scripts/check-vanity-imports.sh $GITHUB_WORKSPACE
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.go-version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.43
- name: Lint proto files
uses: plexsystems/[email protected]
with:
configDirectory: .
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.go-version }}
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Unit Tests
run: go test -timeout 60s ./...
race-tests:
name: Race Tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.go-version }}
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-race
restore-keys: |
${{ runner.os }}-go-
- name: Unit Race Tests
run: go test -timeout 120s -race -gcflags=all=-d=checkptr=0 ./...