Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Conversation

@zappy-shu
Copy link
Collaborator

Initial CI setup including:

  • Makefile for wrapping go commands
  • Chain Dockerfile for building and testing the code and building the github-actions image
  • docker.Makefile for simplifying building in docker locally
  • github actions for on-push and on-pull-request. As this is a private repo these will only work on branches on this repo and not on forks. Note that this is currently only CI. The image is built but not pushed to docker hub

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>
@zappy-shu zappy-shu requested a review from mikeparker February 19, 2020 14:31
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>
Copy link

@mikeparker mikeparker left a 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.

@zappy-shu zappy-shu merged commit f319142 into master Feb 20, 2020
Comment on lines +23 to +25



Copy link

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?

Copy link
Collaborator Author

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
Copy link

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 😁

Copy link
Collaborator Author

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
Copy link

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

Copy link
Collaborator Author

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

@zappy-shu zappy-shu deleted the ci-setup branch March 5, 2020 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants