forked from newrelic/go-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
321 lines (306 loc) · 12.6 KB
/
ci.yaml
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# Copyright 2020 New Relic Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Go Agent CI
on: pull_request
jobs:
go-agent:
runs-on: ubuntu-18.04
env:
# Required when using older versions of Go that do not support gomod.
GOPATH: ${{ github.workspace }}
strategy:
# if one test fails, do not abort the rest
fail-fast: false
matrix:
include:
# v2 agent
# 1.3.x and 1.4.x are failing with a linker error, skip those for now
# - go-version: 1.3.x
# dirs: .
# - go-version: 1.4.x
# dirs: .
- go-version: 1.5.x
dirs: .
- go-version: 1.6.x
dirs: .
- go-version: 1.7.x
dirs: .
- go-version: 1.8.x
dirs: .
- go-version: 1.9.x
dirs: .
- go-version: 1.10.x
dirs: .
- go-version: 1.11.x
dirs: .
- go-version: 1.12.x
dirs: .
- go-version: 1.13.x
dirs: .
# v2 integrations
- go-version: 1.13.x
# only versions up to 0.24.0 of awssdkv2 are supported by this code
pin: github.com/aws/[email protected]
dirs: _integrations/nrawssdk
- go-version: 1.13.x
dirs: _integrations/nrecho
pin: github.com/labstack/[email protected]
- go-version: 1.13.x
dirs: _integrations/nrgorilla/v1
- go-version: 1.13.x
dirs: _integrations/nrlogrus
- go-version: 1.13.x
dirs: _integrations/nrlogxi/v1
- go-version: 1.13.x
dirs: _integrations/nrpkgerrors
- go-version: 1.13.x
dirs: _integrations/nrlambda
- go-version: 1.13.x
dirs: _integrations/nrmysql
- go-version: 1.13.x
dirs: _integrations/nrpq
- go-version: 1.13.x
dirs: _integrations/nrsqlite3
- go-version: 1.13.x
dirs: _integrations/nrgrpc
# As of October 2019, errors result from go get -u github.com/micro/go-micro
# As of June 2020, confirmed errors still result
# - go-version: 1.13.x
# dirs: _integrations/nrmicro
# As of Jul 2022, we have depreciated the legacy nrnats,nrmssql, nrzap, and nrstan integrations tests.
# These tests still exist under the v3 versions of the integrations.
- go-version: 1.13.x
dirs: _integrations/logcontext
- go-version: 1.13.x
dirs: _integrations/nrhttprouter
- go-version: 1.13.x
dirs: _integrations/nrb3
- go-version: 1.13.x
dirs: _integrations/nrmongo
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
uses: actions/checkout@v1
with:
# Required when using older versions of Go that do not support gomod.
# Note the required presence of the /go-agent/ directory at the
# beginning of this path. It is required in order to match the
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
# returns <something/go-agent/go-agent/.
path: ./go-agent/src/github.com/newrelic/go-agent
- name: Run Tests
run: bash build-script.sh
env:
DIRS: ${{ matrix.dirs }}
EXTRATESTING: ${{ matrix.extratesting }}
PIN: ${{ matrix.pin }}
go-agent-v3:
runs-on: ubuntu-18.04
env:
# Required when using older versions of Go that do not support gomod.
GOPATH: ${{ github.workspace }}
strategy:
# if one test fails, do not abort the rest
fail-fast: false
matrix:
include:
- go-version: 1.17.x
dirs: v3/newrelic,v3/internal,v3/examples
- go-version: 1.18.x
dirs: v3/newrelic,v3/internal,v3/examples
- go-version: 1.19.x
dirs: v3/newrelic,v3/internal,v3/examples
# v3 integrations
- go-version: 1.17.x
dirs: v3/integrations/logcontext/nrlogrusplugin
extratesting: go get -u github.com/sirupsen/logrus@master
- go-version: 1.17.x
dirs: v3/integrations/logcontext-v2/nrlogrus
extratesting: go get -u github.com/sirupsen/logrus@master
- go-version: 1.17.x
dirs: v3/integrations/logcontext-v2/nrzerolog
extratesting: go get -u github.com/rs/zerolog@master
- go-version: 1.17.x
dirs: v3/integrations/logcontext-v2/nrwriter
- go-version: 1.17.x
dirs: v3/integrations/logcontext-v2/zerologWriter
extratesting: go get -u github.com/rs/zerolog@master
- go-version: 1.17.x
dirs: v3/integrations/logcontext-v2/logWriter
- go-version: 1.17.x
dirs: v3/integrations/nrawssdk-v1
extratesting: go get -u github.com/aws/aws-sdk-go@main
- go-version: 1.17.x
dirs: v3/integrations/nrawssdk-v2
extratesting: go get -u github.com/aws/aws-sdk-go-v2@main
- go-version: 1.17.x
dirs: v3/integrations/nrecho-v3
# Test against the latest v3 Echo:
extratesting: go get -u github.com/labstack/echo@v3
# go/new/http no longer stable under go 1.17.x
- go-version: 1.17.x
dirs: v3/integrations/nrecho-v4
extratesting: go get -u github.com/labstack/echo/v4@master
- go-version: 1.17.x
dirs: v3/integrations/nrelasticsearch-v7
extratesting: go get -u github.com/elastic/go-elasticsearch/[email protected]
- go-version: 1.18.x
dirs: v3/integrations/nrgin
extratesting: go get -u github.com/gin-gonic/gin@master
- go-version: 1.17.x
dirs: v3/integrations/nrgorilla
extratesting: go get -u github.com/gorilla/mux@master
- go-version: 1.17.x
dirs: v3/integrations/nrgraphgophers
extratesting: go get -u github.com/graph-gophers/graphql-go@master
- go-version: 1.17.x
dirs: v3/integrations/nrlogrus
extratesting: go get -u github.com/sirupsen/logrus@master
- go-version: 1.17.x
dirs: v3/integrations/nrlogxi
extratesting: go get -u github.com/mgutz/logxi@master
- go-version: 1.17.x
dirs: v3/integrations/nrpkgerrors
extratesting: go get -u github.com/pkg/errors@master
- go-version: 1.17.x
dirs: v3/integrations/nrlambda
extratesting: go get -u github.com/aws/aws-lambda-go@master
- go-version: 1.17.x
dirs: v3/integrations/nrmysql
extratesting: go get -u github.com/go-sql-driver/mysql@master
- go-version: 1.17.x
dirs: v3/integrations/nrpq
extratesting: go get -u github.com/lib/pq@master
- go-version: 1.17.x
dirs: v3/integrations/nrpq/example/sqlx
- go-version: 1.17.x
dirs: v3/integrations/nrredis-v7
extratesting: go get -u github.com/go-redis/redis/v7@master
- go-version: 1.17.x
dirs: v3/integrations/nrsqlite3
extratesting: go get -u github.com/mattn/go-sqlite3@master
- go-version: 1.17.x
dirs: v3/integrations/nrsnowflake
extratesting: go get -u github.com/snowflakedb/gosnowflake@master
- go-version: 1.17.x
dirs: v3/integrations/nrgrpc
extratesting: go get -u google.golang.org/grpc@master
- go-version: 1.17.x
dirs: v3/integrations/nrmicro
- go-version: 1.19.x
dirs: v3/integrations/nriris
extratesting: go get -u github.com/kataras/iris/v12@master
# As of Dec 2019, there is a race condition in when using go-micro@master
# in their logging system. Instead, we'll test against the latest
# released version.
# As of Jan 2019, it is impossible to go get the latest micro version.
# As of June 2020, confirmed errors still result
# extratesting: go get -u github.com/micro/go-micro@latest
# If we are using the latest released version to test, we need to use a newer version of go
- go-version: 1.17.x
dirs: v3/integrations/nrnats
extratesting: go get -u github.com/nats-io/nats.go/@master
- go-version: 1.17.x
dirs: v3/integrations/nrnats/test
- go-version: 1.17.x
dirs: v3/integrations/nrstan
extratesting: go get -u github.com/nats-io/stan.go/@master
- go-version: 1.17.x
dirs: v3/integrations/nrstan/test
- go-version: 1.17.x
dirs: v3/integrations/nrstan/examples
- go-version: 1.17.x
dirs: v3/integrations/logcontext
extratesting: go get -u github.com/sirupsen/logrus@master
# nrzap only supports the two most recent minor go releases
- go-version: 1.17.x
dirs: v3/integrations/nrzap
extratesting: go get -u go.uber.org/zap@master
- go-version: 1.17.x
dirs: v3/integrations/nrhttprouter
extratesting: go get -u github.com/julienschmidt/httprouter@master
- go-version: 1.17.x
dirs: v3/integrations/nrb3
- go-version: 1.17.x
dirs: v3/integrations/nrmongo
extratesting: go get -u go.mongodb.org/mongo-driver@master
- go-version: 1.17.x
dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example
extratesting: go get -u github.com/graphql-go/graphql@master
- go-version: 1.17.x
dirs: v3/integrations/nrmssql
extratesting: go get -u github.com/denisenkom/go-mssqldb@master
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Code
uses: actions/checkout@v1
with:
# Required when using older versions of Go that do not support gomod.
# Note the required presence of the /go-agent/ directory at the
# beginning of this path. It is required in order to match the
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
# returns <something/go-agent/go-agent/.
path: ./go-agent/src/github.com/newrelic/go-agent
- name: Run Tests
run: bash v3/build-script.sh
env:
DIRS: ${{ matrix.dirs }}
EXTRATESTING: ${{ matrix.extratesting }}
PIN: ${{ matrix.pin }}
go-agent-arm64:
# Run all unit tests on aarch64 emulator to ensure compatibility with AWS
# Graviton instances
runs-on: ubuntu-18.04
strategy:
# if one test fails, do not abort the rest
fail-fast: false
matrix:
include:
- go-version: 1.17.10
- go-version: 1.18.6
- go-version: 1.19.1
steps:
- uses: actions/checkout@v1
with:
# Required when using older versions of Go that do not support gomod.
# Note the required presence of the /go-agent/ directory at the
# beginning of this path. It is required in order to match the
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
# returns <something/go-agent/go-agent/.
path: ./go-agent/src/github.com/newrelic/go-agent
- uses: uraimo/[email protected]
name: Run Tests
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
install: |
DEBIAN_FRONTEND=noninteractive apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get -qq install -y wget build-essential
wget -nv https://golang.org/dl/go${{ matrix.go-version }}.linux-arm64.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf go${{ matrix.go-version }}.linux-arm64.tar.gz
run: |
export PATH=$PATH:/usr/local/go/bin
go version
cd v3/newrelic
go mod download github.com/golang/protobuf
go get -t
echo ==== v3/newrelic tests ====
go test ./...
cd ../internal
echo ==== v3/internal tests ====
go test ./...
cd ../examples
echo ==== v3/examples tests ====
go test ./...