-
Notifications
You must be signed in to change notification settings - Fork 14
162 lines (154 loc) · 4.81 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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.17
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-beam
- 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
strategy:
matrix:
mongodb-version: [4.2]
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-beam
- name: Start MongoDB v${{ matrix.mongodb-version }}
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Verify MongoDB Installation and Status
run: |
sudo docker ps
- name: Build Binary
run: |
go mod download
cd src
go build ./...
- name: Go Vet
run: |
cd src
go vet ./...
- name: Set up root certificate
env:
PULSAR_CLIENT_CERT: ${{ secrets.PULSAR_CLIENT_CERT }}
run: |
pwd
sudo apt-get install ca-certificates -y
sudo mkdir -p /usr/local/share/ca-certificate
echo $PULSAR_CLIENT_CERT | sed 's/\\n/\n/g' > ./pulsar-ca.crt
sudo cp ./pulsar-ca.crt /usr/local/share/ca-certificate/pulsar-ca.crt
ls /usr/local/share/ca-certificate
sudo update-ca-certificates
ls /etc/ssl/certs
- name: Unit test
run: |
cd src/unit-test/
go test ./...
- name: Run Test and Code Coverage
run: |
echo $TrustStore
pwd
cd ./scripts
./test_coverage.sh
env:
GOPATH: /home/runner/work/pulsar-beam/go
TrustStore: /etc/ssl/certs/ca-certificates.crt
PULSAR_TOKEN: ${{ secrets.PULSAR_TOKEN }}
PULSAR_URI: ${{ secrets.PULSAR_URI }}
REST_DB_TABLE_TOPIC: ${{ secrets.REST_DB_TABLE_TOPIC }}
- name: Upload Coverage
if: github.repository == 'kafkaesque-io/pulsar-beam'
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-beam
e2e_test:
name: e2e_test
needs: [analysis, build_test]
runs-on: ubuntu-latest
strategy:
matrix:
mongodb-version: [4.2]
steps:
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/kafkaesque-io/pulsar-beam
- name: Install dependencies
run: |
pwd
go mod download
- name: Start MongoDB v${{ matrix.mongodb-version }}
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Verify MongoDB Installation and Status
run: |
sudo docker ps
- name: Set up root certificate
env:
PULSAR_CLIENT_CERT: ${{ secrets.PULSAR_CLIENT_CERT }}
run: |
pwd
sudo apt-get install ca-certificates -y
sudo mkdir -p /usr/local/share/ca-certificate
echo $PULSAR_CLIENT_CERT | sed 's/\\n/\n/g' > ./pulsar-ca.crt
sudo cp ./pulsar-ca.crt /usr/local/share/ca-certificate/pulsar-ca.crt
ls /usr/local/share/ca-certificate
sudo update-ca-certificates
ls /etc/ssl/certs
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-beam
- name: Build Docker Image
run: |
pwd
sudo docker build -t pulsar-beam .