-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (91 loc) · 2.57 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
95
96
97
name: ci
on:
push:
branches:
- master
pull_request:
# Also trigger on page_build, as well as release created events
page_build:
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
analysis:
name: static analysis
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-monitor
- name: Lint Go Code
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
go get -u golang.org/x/lint/golint
cd src
golint ./...
- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
build_test:
name: build and test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-monitor
- name: Build Binary
run: |
go mod download
cd src
go build ./...
- name: Go Vet
run: |
cd src
go vet ./...
- name: Go test
run: |
cd src
go test ./...
- name: Run Test and Code Coverage
run: |
pwd
cd ./scripts
./test_coverage.sh
env:
GOPATH: /home/runner/work/pulsar-monitor/go
- name: Upload Coverage
if: github.repository == 'kafkaesque-io/pulsar-monitor'
uses: codecov/[email protected]
with :
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
yml: ./.codecov.yml
fail_ci_fi_error: true
path: go/src/github.com/kafkaesque-io/pulsar-monitor
docker:
name: docker
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-monitor
- name: Build Docker Image
run: |
pwd
sudo docker build -t pulsar-monitor .