GitHub Actions for Go

nwillc
The Startup
Published in
3 min readSep 7, 2020

--

Photo by Laura Ockel on Unsplash

Over time, and through various programming languages, I’ve have always tried to achieve visibility on the following continuous integration (CI) activities on source repository pushes:

  • Tests pass
  • Linting
  • Code coverage statistics

I’ve employed different tools to achieve these based on the languages and repositories. Having recently begun working in Go, I wanted to share the tools I use for it.

CI Tool Chain For Go

For my personal code I use GitHub as a repository, so assuming that the tools I’ll employ are:

  • GitHub Actions: Automate the workflow
  • Codecov.io: A coverage dashboard
  • Readme badges: Easy visibility dashboard on CI status

Codecov Setup

In preparation, setup a Codecov.io account and link the repository from GitHub.com there. The actions to follow will push the data to it.

GitHub Actions For Go

GitHub actions are easy to get started with, simply create a .github/workflows folder in your repository, and drop YAML files in there to describe workflows. So let’s discuss a .github/workflows/ci.yml file in stages, and glue it all together at the end. First we want our…

--

--

nwillc
The Startup

Graybeard code monkey, started on an Apple IIe, got a CS degree in the 80’s, and coded my way through C, C++, Objective-C, Java, Kotlin — and now Go.