Nothing Special   »   [go: up one dir, main page]

Skip to content

atc0005/go-ci

Repository files navigation

go-ci

Tooling for linting, testing and building Go applications

Latest Release Project Analysis Build images

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.

Docker images

See these container image registries for the full listing of available images:

Overview

A mix of GitHub Actions / CI focused Docker container images primarily intended to simplify linting/testing/building other Go projects that I maintain. I am developing the content in the open in case it is useful to others.

Linting tools included

Unless indicated otherwise, the following linting tools are included in the go-ci-stable, go-ci-oldstable and go-ci-unstable images:

Linter Version
staticcheck 2024.1.1 (v0.5.1)
golangci-lint v1.62.2
govulncheck v1.1.3
deadcode v0.27.0
pelletier/go-toml v2.2.3
fatih/errwrap v1.6.0

Forks:

Linter Version
orijtech/httperroryzer 9f94717820d4a5075117680de2ca07875d32c9f1
orijtech/structslop 33c868804e9e6070fdaee64b729d3129bbe85a53
orijtech/tickeryzer b38acaa6d76d30629a49ad9eddd1aa5ddd0afa8f

Build tools included

The following build tools are included in all *-build* images except for the *-mirror-* images:

Build tool Version
tc-hib/go-winres v0.3.3
goreleaser/nfpm v2.41.1
choffmeister/git-describe-semver v0.4.0

Testing tools included

The following testing tools are included in the go-ci-stable, go-ci-oldstable and go-ci-unstable images:

Testing tool Version
bitfield/gotestdox v0.2.2

Images

Matrix images

go-ci-stable

  • built from the latest version of the current stable golang image.
  • used for building and testing 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
  • ✔️ provides testing tools
  • ❌ does not include custom build tools

go-ci-oldstable

  • built from the latest version of the current outgoing stable golang image.
  • used for building and testing 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
  • ✔️ provides testing tools
  • ❌ does not include custom build tools

go-ci-unstable

  • built from the latest available non-stable golang:beta image, 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 and testing 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
  • ✔️ provides testing tools
  • ❌ does not include custom build tools
  • used to test new or additional golangci-lint linters prior to inclusion in the stable and oldstable container image 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

General build images

go-ci-oldstable-alpine-buildx86

go-ci-oldstable-alpine-buildx64

go-ci-stable-alpine-buildx86

go-ci-stable-alpine-buildx64

go-ci-unstable-alpine-buildx86

go-ci-unstable-alpine-buildx64

go-ci-oldstable-cgo-mingw-w64-buildx86

  • built from the latest version of the current outgoing stable i386/golang image
  • used for building and testing Go applications, both directly and via Makefile builds.
  • supports cross-platform, cgo-enabled builds for Windows and Linux
    • Windows 32-bit: i686-w64-mingw32-gcc
    • Windows 64-bit: x86_64-w64-mingw32-gcc
  • ✔️ provides Fyne toolkit build dependencies
  • ✔️ provides multiple custom build tools
  • ❌ does not include linters
  • ❌ does not include testing tools

go-ci-oldstable-cgo-mingw-w64-buildx64

go-ci-stable-cgo-mingw-w64-buildx86

  • built from the latest version of the current stable i386/golang image
  • used for building and testing Go applications, both directly and via Makefile builds.
  • supports cross-platform, cgo-enabled builds for Windows and Linux
    • Windows 32-bit: i686-w64-mingw32-gcc
    • Windows 64-bit: x86_64-w64-mingw32-gcc
  • ✔️ provides multiple custom build tools
  • ✔️ provides Fyne toolkit build dependencies
  • ❌ does not include linters
  • ❌ does not include testing tools

go-ci-stable-cgo-mingw-w64-buildx64

go-ci-unstable-cgo-mingw-w64-buildx86

  • built from the latest available non-stable (beta, rc or if not available the latest stable) golang image.
  • used for building and testing Go applications, both directly and via Makefile builds.
  • supports cross-platform, cgo-enabled builds for Windows and Linux
    • Windows 32-bit: i686-w64-mingw32-gcc
    • Windows 64-bit: x86_64-w64-mingw32-gcc
  • ✔️ provides multiple custom build tools
  • ✔️ provides Fyne toolkit build dependencies
  • ❌ does not include linters
  • ❌ does not include testing tools

go-ci-unstable-cgo-mingw-w64-buildx64

Mirror build images

go-ci-mirror-build-*

  • built from the latest version of the golang image for that series
    • e.g., the go-ci-mirror-build-go1.14 image is built from the final release version in the 1.14 series (1.14.15)
  • intended to mirror the upstream golang image for Makefile-driven testing, linting and build tasks.
  • few (if any) customizations are intended for this image, instead relying on a project's Makefile or other build tool to setup the environment for tasks such as testing, linting & building source code
  • ❌ does not include linters
  • ❌ does not include testing tools
  • ❌ does not include custom build tools

These images are intended to assist with asserting that projects build with the latest version in a specific series.

go-ci-oldstable-mirror-build

Unlike most other images, the go-ci-oldstable-mirror-build name is not the title of an image (such as go-ci-stable), but rather an additional tag for the latest version of the golang image for the oldstable series.


  • built from the latest version of the golang image for the oldstable series
    • e.g., if the latest oldstable version of the Go toolchain is 1.19.6 and 1.20.1 is the latest in the stable series, the go-ci-oldstable-mirror-build image will refer to the 1.19.6 image
  • intended to mirror the latest oldstable (outgoing) upstream golang image for Makefile-driven testing, linting and build tasks.
  • few (if any) customizations are intended for this image, instead relying on a project's Makefile or other build tool to setup the environment for tasks such as testing, linting & building source code
  • ❌ does not include linters
  • ❌ does not include testing tools
  • ❌ does not include custom build tools

These images are intended to assist with asserting that projects build with the latest version in the outgoing stable (aka, oldstable) series.

go-ci-stable-mirror-build

Unlike most other images, the go-ci-stable-mirror-build name is not the title of an image (such as go-ci-stable), but rather an additional tag for the latest version of the golang image for the stable series.


  • built from the latest version of the golang image for the current stable series
    • e.g., if the latest oldstable version of the Go toolchain is 1.19.6 and 1.20.1 is the latest in the stable series, the go-ci-stable-mirror-build image tag will refer to the 1.20.1 image
  • intended to mirror the latest stable (current) upstream golang image for Makefile-driven testing, linting and build tasks.
  • few (if any) customizations are intended for this image, instead relying on a project's Makefile or other build tool to setup the environment for tasks such as testing, linting & building source code
  • ❌ does not include linters
  • ❌ does not include testing tools
  • ❌ does not include custom build tools

These images are intended to assist with asserting that projects build with the latest version in the current stable series.

Release build images

go-ci-stable-build

  • built from the latest version of the current stable golang image.
  • used for building dev and stable releases of Go code
  • ✔️ provides multiple custom build tools
  • ❌ does not include linters
  • ❌ does not include testing tools

go-ci-oldstable-build

  • built from the latest version of the current outgoing stable golang image.
  • used for building dev and stable releases of Go code
  • ✔️ provides multiple custom build tools
  • ❌ does not include linters
  • ❌ does not include testing tools

go-ci-unstable-build

  • built from the latest available non-stable golang:beta image, 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 dev and stable releases of Go code
  • ✔️ provides multiple custom build tools
  • ❌ does not include linters
  • ❌ does not include testing tools

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 project.

Requirements

  • Docker
    • for building images
  • make
    • if using the provided Makefile
  • Sufficient disk space to hold build images
    • 20+ GB free disk space recommended if building all images
    • 10+ GB free disk space recommended if building one set of images

References