-
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (42 loc) · 1.14 KB
/
test_and_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
name: Test & Build
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
GO111MODULE: on
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
test_and_build:
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Set GOPATH and PATH
# temporary fix
# see https://github.com/actions/setup-go/issues/14
run: |
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Install dependencies
run: go get -v golang.org/x/lint/golint
- name: Build
run: go build
- name: Lint
run: golint -set_exit_status ./...
- name: Test
run: go test -race --coverprofile=coverage.txt --covermode=atomic ./...