Skip to content

Commit

Permalink
Use go modules for dependency management
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Jul 16, 2019
1 parent 35d6894 commit b0cc5fb
Show file tree
Hide file tree
Showing 12 changed files with 545 additions and 2,062 deletions.
33 changes: 20 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ defaults:
go-1_10: &go-1_10
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.10.8'
environment:
GO111MODULE: 'on'
go-1_11: &go-1_11
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.11.10'
environment:
GO111MODULE: 'on'
go-1_12: &go-1_12
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.12.5'
environment:
GO111MODULE: 'on'

version: 2
jobs:
Expand All @@ -19,54 +25,55 @@ jobs:
steps:
- checkout
- restore_cache:
key: vendor-{{ checksum "Gopkg.lock" }}
key: go-mod-v1-{{ checksum "go.sum" }}
- run: 'make deps'
- run: 'dep check'
- run: 'go mod vendor' # in order to not break < go1.11
- run: 'go mod verify'
- 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:
- '*'

test-go-1.10:
<<: [ *defaults, *go-1_10 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
# disabled due to gofmt differences (1.10 vs 1.11).
#- run: 'make check'
- run: 'make test'
test-go-1.11:
<<: [ *defaults, *go-1_11 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make check'
- run: 'make test'
test-go-1.12:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'
test-go-1.12-386:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'GOARCH=386 make check'
- run: 'GOARCH=386 make test'

package:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package'
- store_artifacts:
path: './build'
Expand All @@ -75,7 +82,7 @@ jobs:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package-release'
- store_artifacts:
path: './build'
Expand All @@ -84,7 +91,7 @@ jobs:
<<: [ *defaults, *go-1_12 ]
steps:
- attach_workspace:
at: '/go/src'
at: '/go'
- run: 'make package-nightly'
- store_artifacts:
path: './build'
Expand Down
Loading

0 comments on commit b0cc5fb

Please sign in to comment.