Use Go modules for dependency management (#6912)

This commit is contained in:
Daniel Nelson
2020-01-16 14:38:06 -08:00
committed by GitHub
parent 17c165391b
commit 5f1f4b9e8d
10 changed files with 771 additions and 46 deletions

View File

@@ -7,6 +7,8 @@ defaults:
go-1_12: &go-1_12
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.12.14'
environment:
GO111MODULE: 'on'
go-1_13: &go-1_13
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.13.5'
@@ -18,16 +20,16 @@ jobs:
steps:
- checkout
- restore_cache:
key: vendor-{{ checksum "Gopkg.lock" }}
key: go-mod-v1-{{ checksum "go.sum" }}
- run: 'make deps'
- run: 'dep check'
- run: 'make tidy'
- save_cache:
name: 'vendored deps'
key: vendor-{{ checksum "Gopkg.lock" }}
name: 'go module cache'
key: go-mod-v1-{{ checksum "go.sum" }}
paths:
- './vendor'
- '/go/pkg/mod'
- persist_to_workspace:
root: '/go/src'
root: '/go'
paths:
- '*'
@@ -35,28 +37,32 @@ jobs:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make'
- run: 'make check'
- run: 'make test'
test-go-1.12-386:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'
test-go-1.13:
<<: [ *defaults, *go-1_13 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make'
- run: 'make check'
- run: 'make test'
test-go-1.13-386:
<<: [ *defaults, *go-1_13 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'GOARCH=386 make'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'
@@ -64,7 +70,7 @@ jobs:
<<: [ *defaults, *go-1_13 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package'
- store_artifacts:
path: './build'
@@ -73,7 +79,7 @@ jobs:
<<: [ *defaults, *go-1_13 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package-release'
- store_artifacts:
path: './build'
@@ -82,7 +88,7 @@ jobs:
<<: [ *defaults, *go-1_13 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package-nightly'
- store_artifacts:
path: './build'