-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (50 loc) · 1.75 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
name: Go
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test
strategy:
matrix:
golang: ["1.16"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Remove previous jobs
uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# NOTE: Don't stop master or tags jobs since they might be uploading assets and result into a partial release
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && matrix.os == 'ubuntu-latest'"
- name: Set up Go ${{ matrix.golang }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.golang }}
id: go
- name: Check out code into the Go module directory
uses: actions/[email protected]
- name: Download golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.37.1
if: "matrix.os == 'ubuntu-latest'"
- name: Lint
run: $(go env GOPATH)/bin/golangci-lint run --timeout=10m
if: "matrix.os == 'ubuntu-latest'"
- uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test (continue on error)
run: go run mage.go test
if: "matrix.os == 'windows-latest'"
continue-on-error: true
- name: Test (stop on error)
run: go run mage.go test
if: "matrix.os != 'windows-latest'"
continue-on-error: false