-
Notifications
You must be signed in to change notification settings - Fork 191
94 lines (81 loc) · 2.31 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
strategy:
matrix:
go: [1.16, 1.15, 1.14]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run linters
uses: golangci/golangci-lint-action@v2
with:
version: v1.41
test:
strategy:
matrix:
go: [1.16, 1.15, 1.14]
grafana: [6.7.1, 6.6.2, 6.5.3, 6.4.5]
env:
GRAFANA_INTEGRATION: 1
services:
grafana:
# Docker Hub image
image: "grafana/grafana:${{ matrix.grafana }}"
ports:
- 3000:3000
options: >-
-e GF_AUTH_ANONYMOUS_ENABLED=true
chromedp:
image: "chromedp/headless-shell:91.0.4472.69"
ports:
- 9222:9222
options: >-
--shm-size 2G
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Calculate coverage with the newest Go version.
- name: Calc coverage
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}"
run: |
go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Test
if: "${{ matrix.go != '1.16' && matrix.grafana != '6.7.1' }}"
run: go test -v ./...
- name: Convert coverage.out to coverage.lcov
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}"
uses: jandelgado/gcov2lcov-action@v1.0.6
- name: Coveralls
if: "${{ matrix.go == '1.16' && matrix.grafana == '6.7.1' }}"
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov