Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update go version in circleci workflows #28

Merged
merged 6 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@ version: 2.1
orbs:
buildevents: honeycombio/[email protected]

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
working_directory: /home/circleci/go/src/github.com/honeycombio/dynsampler-go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think working directory is necessary. I removed it recently on another repo PR that updated the docker image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was present here and in libhoney-go. But let's find out! 🧑‍🔬 :atom: ⚗️ 🧪

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

docker:
- image: circleci/golang:1.<< parameters.goversion >>
- image: cimg/go:1.<< parameters.goversion >>
environment:
GO111MODULE: "on"

jobs:
setup:
Expand All @@ -23,17 +33,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 ./...
Expand All @@ -42,21 +59,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
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/honeycombio/dynsampler-go
robbkidd marked this conversation as resolved.
Show resolved Hide resolved

go 1.12

require github.com/stretchr/testify v1.6.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting here for posterity: this is the version that still works with Go 1.12. testify 1.7 requires Go 1.13.

11 changes: 11 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=