-
Notifications
You must be signed in to change notification settings - Fork 33
DESKTOP-2463 initial CI setup #1
Conversation
Adding the basics for the CI workflow include: - Makefile for running the go commands including lint checks with golangci-lint - Chain docker build using the Makefile that outputs an image containing the final executable - GitHub action workflow to checkout, build, lint, and test the code and build the final image. Pushing of the image will be done on a separate workflow and only done on tagging Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adding docker.Makefile that simplifies building the code in docker Signed-off-by: Nick Adcock <nick.adcock@docker.com>
Adds the GOLANGCI_LINT_VERSION ARG to the Dockerfile so it's easier to maintain which version to use Signed-off-by: Nick Adcock <nick.adcock@docker.com>
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'm not a golang expert, so it'd be good to pass this by someone like Mathieu next week when he's back (or when this is in a reviewable state, i don't know if thats better to sort earlier or later), but regardless we shouldnt block on that and this LGTM so far.
|
|
||
|
|
||
|
|
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.
nit: any reason for the multiple blank lines?
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.
Just to make it easier to spot the breaks between the separate images. I'm going to add some comments in with the e2e step which should make life a bit simpler
| ## Building github-actions | ||
| The code is written in Go v1.13 with `go mod`. It can be built locally using the `Makefile` or in docker using the `docker.Makefile`. | ||
|
|
||
| `make -f docker.Makefile` will build the code, check the linting using golangci-lint, run the go tests, and build the image with a tag of docker/github-actions:latest |
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 don’t have make on my machine 😁
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.
Get it :)
Seriously though, it's just to make it less typing to build and run the images. For just building and running the linter and unit tests you can just do a docker build but the e2e tests are a bit more complicated so hiding this in a script is easier and make is the standard tool for such.
Note this setup is basically lifted from other docker repos like app and cli. If you have any suggestions on how to improve it I'd be happy to chat. Note that with the e2e tests I'm going to try and make sure the make scripts work in powershell as well as bash
| @@ -1,2 +1,16 @@ | |||
| # github-actions | |||
| Core code for all Docker's github actions | |||
| The core code base for Docker's GitHub Actions (https://github.com/features/actions). This code is used to build the docker/github-actions image that provides the functionality used by the published Docker GitHub Actions | |||
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.
nit: missing a dot at the end of the sentence
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.
Probably a lot of that. The readme is just a placeholder with some notes on running the builds. Once I've done the spike it will need to be re-written with all the various options and the like so I'm not putting much effort into it just this minute.
If we are going to open source this then will probably want to pull the build instructions out into a BUILDING.md and add a CONTRIBUTION.md
Initial CI setup including: