Skip to content

atc0005/go-ci

Repository files navigation

go-ci

Tooling for linting, testing and building Go applications

Latest Release Linting Validate Docs

Table of contents

Project home

See our GitHub repo for the latest content, to file an issue or submit improvements for review and potential inclusion into the project.

See our Docker Hub repo for the full listing of available container images.

Overview

A mix of GitHub Actions / CI focused Docker containers primarily intended to simplify linting/testing/building other Go projects that I maintain. I am developing the content in the open in case what I learn here in this project is useful to others.

Linting tools included

Linter Version
staticcheck 2021.1.1 (v0.2.1)
golangci-lint v1.43.0
orijtech/httperroryzer v0.0.1
orijtech/structslop v0.0.6
pelletier/go-toml/cmd/tomll v1.9.4
fatih/errwrap v1.3.1

Docker images

See our Docker Hub repo for the full listing of available container images.

go-ci-stable

  • built from the latest version of the current stable golang image.
  • used for building Go applications, both directly and via Makefile builds.
  • intended for use in a build/test matrix of prior, current and upcoming Go releases
  • provides multiple linters

go-ci-stable-alpine-buildx86

  • based on the latest version of the current stable i386/golang alpine image.
  • used for building Go applications, both directly and via Makefile builds.
  • uses musl libc instead of glibc
  • supports cross-platform, static cgo-enabled builds for Windows and Linux
    • Windows 32-bit: i686-w64-mingw32-gcc
    • Windows 64-bit: x86_64-w64-mingw32-gcc
  • does not include linters

go-ci-stable-alpine-buildx64

  • same as go-ci-stable-alpine-buildx86, but specific to x64 architecture
  • does not include linters

go-ci-stable-debian-build

  • built from the latest version of the current stable golang image.
  • used for building Go applications, both directly and via Makefile builds.
  • supports cross-platform, static cgo-enabled builds for Windows and Linux
    • Windows 32-bit: i686-w64-mingw32-gcc
    • Windows 64-bit: x86_64-w64-mingw32-gcc
  • provides multiple linters

go-ci-oldstable

  • built from the latest version of the current outgoing stable golang image.
  • used for building Go applications, both directly and via Makefile builds.
  • intended for use in a build/test matrix of prior, current and upcoming Go releases
  • provides multiple linters

go-ci-unstable

  • built from the latest available non-stable golang:rc image or if not recently available, the latest stable golang image
    • intended to test whether new Go versions break existing code or surface problems in existing code that current Go releases do not
  • used for building Go applications, both directly and via Makefile builds
  • intended for use in a build/test matrix of prior, current and upcoming Go releases
  • provides multiple linters
  • used to test new or additional golangci-lint linters prior to inclusion in the stable and oldstable container variants
    • new linters as a whole may be added to multiple image variants, not just this image unless it is suspected that the new linters are highly experimental/unstable

go-ci-lint-only

  • smaller image
  • uses golangci/golangci-lint:vX.Y.Z-alpine image as base
  • created as part of a multi-stage container build
  • intended for lightweight testing of iterative branch changes
    • e.g., testing or squash/rebase branch work prior to a full suite of checks usually associated with Pull Requests
  • limited linters

Examples / How to use these images

For real-world examples of how these images are used, please see the workflows for these projects:

Changelog

See the CHANGELOG.md file for the changes associated with each release of this application. Changes that have been merged to master, but not yet an official release may also be noted in the file under the Unreleased section. A helpful link to the Git commit history since the last official release is also provided for further review.

Requirements

  • Docker
    • for building images
  • make
    • if using the provided Makefile

References