-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.37 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
name: Golang CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build
strategy:
matrix:
go-version: [ 1.18 ]
platform: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go
uses: actions/cache@v2
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
'%LocalAppData%\go-build'
- name: Test Go
run: go test ./...
- name: Build Go
run: |
go build -o bin/grafana-plot cmd/grafana-plot/main.go
go build -o bin/prometheus-plot cmd/prometheus-plot/main.go
- name: Upload Go Binary
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-app
path: bin/*-plot
if-no-files-found: error