-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 1.69 KB
/
build.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
name: Build
on:
push:
paths:
- .github/workflows/build.yml
- "**.go"
- go.sum
- go.mod
pull_request:
paths:
- .github/workflows/build.yml
- "**.go"
- go.sum
- go.mod
workflow_dispatch:
branches: ["*"]
env:
GO_VERSION: 1.17
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
timeout-minutes: 2
strategy:
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
fail-fast: false
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Build
run: go build -v .
test:
name: Test
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
fail-fast: false
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Test
run: go test ./... -race -cover -v