-
Notifications
You must be signed in to change notification settings - Fork 19
75 lines (64 loc) · 1.36 KB
/
test.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
name: Tests
on:
pull_request:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'website/*'
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'website/*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go fmt
run: |
# exit 1 if any files need go fmt
test -z $(gofmt -s -l .)
- name: Go vet
run: |
go vet ./...
- name: Build
run: |
go build -v .
test:
name: Test
needs: build
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Unit tests
timeout-minutes: 5
run: |
go test -v -race ./...
- name: E2E tests
timeout-minutes: 25
env:
E2E_TESTING: 1
run: |
go test -timeout=20m -v ./...