-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (47 loc) · 1.17 KB
/
testingv2.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
# Name of the workflow needs to match the name of the major version directory
name: v2
on:
push:
paths:
- 'v2/**'
pull_request:
paths:
- 'v2/**'
jobs:
build:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.11.x', '1.12.x', '1.13.x' ]
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Test well formatted with gofmt
run: |
GO_FILES=$(find ${GITHUB_WORKFLOW} -iname '*.go' -type f | grep -v /vendor/)
test -z $(gofmt -s -d -l -e $GO_FILES | tee /dev/fd/2 | xargs | sed 's/\s//g')
id: gofmt
- name: Go vet
run: |
cd ${GITHUB_WORKFLOW}
go vet ./...
id: govet
- name: Unit tests
run: |
cd ${GITHUB_WORKFLOW}
go test -race ./...
id: unitTests
- name: Unit tests (32bit)
run: |
cd ${GITHUB_WORKFLOW}
go test ./...
env:
GOARCH: 386
id: unitTest32