forked from cweill/gotests
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.47 KB
/
go.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
name: Go
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 1.16.x, 1.15.x, 1.14.x, 1.13.x, 1.12.x, 1.11.x, 1.10.x, 1.9.x ]
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: auto
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/cweill/gotests
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/cweill/gotests
- name: Get Dependencies (github.com/golang.org/x/tools/imports)
run: go get -v ./...
- name: Test
run: |
go test -v ./...
- name: Coverage Dependencies
if: matrix.go == '1.16.x'
run: |
go get github.com/mattn/goveralls
go get -v ./...
- name: Coverage Reporting Generation
if: matrix.go == '1.16.x'
run: |
export PKGS=$(go list ./... | grep -vE "(gotests/gotests|.*data|templates)" | tr -s '\n' ',' | sed 's/.\{1\}$//')
go test -v -covermode=count -coverpkg=$PKGS -coverprofile=coverage.cov
- name: Coverage - Sending Report to Coveral
if: matrix.go == '1.16.x'
run: $GOPATH/bin/goveralls -coverprofile=coverage.cov -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}