-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (29 loc) · 963 Bytes
/
go.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
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
GOCACHE: /home/runner/work/omg/.cache/go-build
GOMODCACHE: /home/runner/go/pkg/mod
name: Go build and test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: go.sum
- name: sudo go version
run: sudo go version
- name: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go env
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go env
- name: Build root
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go build -v .
- name: Test root
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go test -p 1 -timeout 60s ./...
- name: Test root race
run: sudo GOCACHE=$GOCACHE GOMODCACHE=$GOMODCACHE go test -p 1 -timeout 240s --race ./...