-
Notifications
You must be signed in to change notification settings - Fork 2.8k
56 lines (43 loc) · 1.13 KB
/
push.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
name: 'push'
on:
push:
pull_request:
env:
GO111MODULE: on
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows, macOS ]
go: [ 1.12.x, 1.13.x, 1.14.x ]
runs-on: ${{ matrix.os }}-latest
steps:
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- name: Run golangci-lint
if: matrix.os == 'ubuntu'
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./ latest
./golangci-lint run -v
- name: Run tests
shell: bash
run: |
go get -v github.com/kyoh86/richgo@v0.3.3
$HOME/go/bin/richgo test -v ./...
- name: Check formatting
if: matrix.os != 'windows'
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Build
run: |
cd cobra
go build
- name: go vet
if: matrix.os != 'windows'
run: |
if [ -z $NOVET ]; then
diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
fi