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
Build both go-1.13 and go-1.14 in circleci #569
Build both go-1.13 and go-1.14 in circleci #569
Conversation
The current branch protections require Possible checks github will let me set required:
|
@lizthegrey Done. I'm a CircleCI neophyte - this could likely be done better using v2.1 |
.circleci/config.yml
Outdated
|
||
build: | ||
docker: | ||
- image: circleci/golang:1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the build
stanza doesn't need the image here, is that right? (Not that it hurts.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been reading the CircleCI docs and every job needs to specify an executor (docker, machine, macos or windows). So even if we want an empty build, we need to have an executor. And docker executor requires specifying the image name.
So maybe instead of having three jobs (build, go-1.13 and go-1.14) how about we have two jobs - build and old-go-build? The build job could depend on the old-go-build job. That way, if the new version of go is released, all we need to update is docker image names. Job names will stay the same. Dependencies stay the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could limit the number of jobs to 2 and limit having places where we specify go version to docker image names.
.circleci/config.yml
Outdated
|
||
build: | ||
docker: | ||
- image: circleci/golang:1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been reading the CircleCI docs and every job needs to specify an executor (docker, machine, macos or windows). So even if we want an empty build, we need to have an executor. And docker executor requires specifying the image name.
So maybe instead of having three jobs (build, go-1.13 and go-1.14) how about we have two jobs - build and old-go-build? The build job could depend on the old-go-build job. That way, if the new version of go is released, all we need to update is docker image names. Job names will stay the same. Dependencies stay the same.
We could do the "current-go"/"prior-go" but I think the "requires" directive would result in the two builds running sequentially - effectively doubling the build time, whereas in reality the two builds are independent. |
I've changed this to use pre-defined executors and parametrizable jobs to enable just two "names-without-versions" jobs:
The Each job can be changed simply by bumping up the version for each of the predefined executors when a new version of go is released. @lizthegrey Does this change what you see in the required checks that the CircleCI/github integration provides? I removed the "build" job and now have the workflow that builds the source on both the current and prior versions of go called
At least when I tried this new method on my own repository, I now see a checkbox in the Branch Protections called just Once again, I'm only running into CircleCI for the second time, so if this doesn't work or there are better ways to achieve this (I do see a lot of people requesting TravisCI like matrix builds in their forums), let me know. |
This looks very nice, thanks! But I think some config somewhere needs to be updated, because we can see now that github is waiting for the nonexistent "build" job. |
Yes, that's my question to @lizthegrey above. On my test repo, after I started using this new configuration, a new "check" type showed up on my protected branch page with just the title |
wouldn't |
Yes, it would, but based on the CircleCI docs, it seems they would prefer users of these checks move to using workflow names rather than job names. Just wanted to see what showed up on the Branch Protection "Checks" page. |
I can address the branch protections no problem. |
@lizthegrey can you advise on this? I'm not sure what is needed. |
https://github.com/open-telemetry/opentelemetry-go/settings/branch_protection_rules/5356663 updated, re-running the tests and will merge. |
331de30
to
2ebd2a6
Compare
Verified the cache settings work now. |
Per gitter.im discussion re: support for at least two most recent versions of go, this PR changes the circleci build config to build the project in both go-1.13 and go-1.14 versions.