diff --git a/.circleci/config.yml b/.circleci/config.yml index 3993193..d455603 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,15 +3,24 @@ version: 2.1 orbs: buildevents: honeycombio/buildevents@0.2.3 +matrix_goversions: &matrix_goversions + matrix: + parameters: + goversion: ["12", "13", "14", "15", "16", "17"] + +# Default version of Go to use for Go steps +default_goversion: &default_goversion "17" + executors: go: parameters: goversion: type: string - default: "12" - working_directory: /go/src/github.com/honeycombio/dynsampler-go + default: *default_goversion docker: - - image: circleci/golang:1.<< parameters.goversion >> + - image: cimg/go:1.<< parameters.goversion >> + environment: + GO111MODULE: "on" jobs: setup: @@ -23,17 +32,24 @@ jobs: steps: - buildevents/watch_build_and_finish - test_dynsampler: + test: parameters: goversion: type: string - default: "12" + default: *default_goversion executor: name: go goversion: "<< parameters.goversion >>" steps: - buildevents/with_job_span: steps: + - when: + condition: + equal: ["12", "<< parameters.goversion >>" ] + steps: + - run: + name: Update certs in old CI image + command: sudo apt-get update && sudo apt-get install -y ca-certificates - checkout - run: go get -v -t -d ./... - run: go test -race -v ./... @@ -42,21 +58,13 @@ jobs: field_value: << parameters.goversion >> workflows: - build_dynsampler: + test: jobs: - setup - watch: requires: - setup - - test_dynsampler: - goversion: "10" - requires: - - setup - - test_dynsampler: - goversion: "11" - requires: - - setup - - test_dynsampler: - goversion: "12" + - test: + <<: *matrix_goversions requires: - setup diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..498ed66 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/honeycombio/dynsampler-go + +go 1.12 + +require github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..afe7890 --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=