Skip to content

fix(deps): use consistent Go version in builds and CI#377

Merged
cwaldren-ld merged 2 commits into
mainfrom
cw/consistent-go-version
Jul 11, 2024
Merged

fix(deps): use consistent Go version in builds and CI#377
cwaldren-ld merged 2 commits into
mainfrom
cw/consistent-go-version

Conversation

@cwaldren-ld
Copy link
Copy Markdown
Contributor

@cwaldren-ld cwaldren-ld commented Jul 11, 2024

Currently we are building with whatever Go version is installed on the runner at the time of the build. At the same time, we're testing with a particular Go version in CI.

This PR unifies the versions used in test and build. That way we know we've tested what we're shipping.

  • PR has a matrix build of go versions

@cwaldren-ld cwaldren-ld force-pushed the cw/consistent-go-version branch from ea668e8 to 8073ac3 Compare July 11, 2024 00:32
- name: Set Go Version Matrices
id: set-matrix
run: |
echo "all=[\"${{ steps.set-env.outputs.latest }}\",\"${{ steps.set-env.outputs.penultimate }}\"]" >> $GITHUB_OUTPUT
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(This whole file is copied from Relay. It'd be nice to make it reusable.. but not sure it's worth it yet.)

@cwaldren-ld
Copy link
Copy Markdown
Contributor Author

cwaldren-ld commented Jul 11, 2024

There is a choice we can make for supporting Go versions. We can support the latest release N and penultimate N-1, and keep these up-to-date automatically with a workflow.

This would be equivalent to roughly 1 year of Go support, and is what Relay does.

Or, we could support latest release N and some other minimum compatible version < N, not necessarily the penultimate. This allows for wider compatibility, at the cost of having to think about when to bump the minimum version.

Since we're shipping binaries of this, and people likely aren't building from source, I think the first option is easiest.

Comment thread go.mod
module github.com/launchdarkly/ldcli

go 1.20
go 1.21
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Although it's not strictly true that we require 1.21, since we're building with 1.21 and 1.22 we can't claim this. See my other comment for an alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants