Skip to content

Commit

Permalink
Merge pull request #1462 from atc0005/i1459-add-gotestdox
Browse files Browse the repository at this point in the history
Add github.com/bitfield/gotestdox
  • Loading branch information
atc0005 authored Mar 29, 2024
2 parents 5e99019 + 11b5c9c commit 01baba5
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 7 deletions.
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Tooling for linting, testing and building Go applications
- [Overview](#overview)
- [Linting tools included](#linting-tools-included)
- [Build tools included](#build-tools-included)
- [Testing tools included](#testing-tools-included)
- [Images](#images)
- [Matrix images](#matrix-images)
- [`go-ci-stable`](#go-ci-stable)
- [`go-ci-oldstable`](#go-ci-oldstable)
Expand Down Expand Up @@ -93,6 +95,17 @@ the `*-mirror-*` images:
| [`goreleaser/nfpm`](https://github.com/goreleaser/nfpm) | `v2.35.3` |
| [`choffmeister/git-describe-semver`](https://github.com/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`](https://github.com/bitfield/gotestdox) | `v0.2.2` |

## Images

### Matrix images

#### `go-ci-stable`
Expand All @@ -103,6 +116,7 @@ the `*-mirror-*` images:
- intended for use in a build/test matrix of prior, current and upcoming Go
releases
- ✔️ provides [multiple linters](#linting-tools-included)
- ✔️ provides [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)

#### `go-ci-oldstable`
Expand All @@ -113,6 +127,7 @@ the `*-mirror-*` images:
- intended for use in a build/test matrix of prior, current and upcoming Go
releases
- ✔️ provides [multiple linters](#linting-tools-included)
- ✔️ provides [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)

#### `go-ci-unstable`
Expand All @@ -126,6 +141,7 @@ the `*-mirror-*` images:
- intended for use in a build/test matrix of prior, current and upcoming Go
releases
- ✔️ provides [multiple linters](#linting-tools-included)
- ✔️ provides [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)
- used to test new or additional `golangci-lint` linters prior to inclusion in
the `stable` and `oldstable` container image variants
Expand All @@ -150,12 +166,14 @@ the `*-mirror-*` images:
- Windows 64-bit: `x86_64-w64-mingw32-gcc`
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-oldstable-alpine-buildx64`

- same as `go-ci-oldstable-alpine-buildx86`, but specific to x64 architecture
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-stable-alpine-buildx86`

Expand All @@ -172,12 +190,14 @@ the `*-mirror-*` images:
- Windows 64-bit: `x86_64-w64-mingw32-gcc`
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-stable-alpine-buildx64`

- same as `go-ci-stable-alpine-buildx86`, but specific to x64 architecture
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-unstable-alpine-buildx86`

Expand All @@ -194,12 +214,14 @@ the `*-mirror-*` images:
- Windows 64-bit: `x86_64-w64-mingw32-gcc`
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-unstable-alpine-buildx64`

- same as `go-ci-unstable-alpine-buildx86`, but specific to x64 architecture
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -213,6 +235,7 @@ the `*-mirror-*` images:
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -221,6 +244,7 @@ the `*-mirror-*` images:
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -233,6 +257,7 @@ the `*-mirror-*` images:
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -241,6 +266,7 @@ the `*-mirror-*` images:
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -254,6 +280,7 @@ the `*-mirror-*` images:
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

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

Expand All @@ -262,6 +289,7 @@ the `*-mirror-*` images:
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ✔️ provides [Fyne toolkit build dependencies](https://docs.fyne.io/started/)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

### Mirror build images

Expand All @@ -276,6 +304,7 @@ the `*-mirror-*` images:
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](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)

These images are intended to assist with asserting that projects build with
Expand All @@ -300,6 +329,7 @@ the latest version of the `golang` image for the `oldstable` series.
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](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)

These images are intended to assist with asserting that projects build with
Expand All @@ -324,6 +354,7 @@ the latest version of the `golang` image for the `stable` series.
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](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)
- ❌ does not include [custom build tools](#build-tools-included)

These images are intended to assist with asserting that projects build with
Expand All @@ -337,13 +368,15 @@ the latest version in the current stable series.
- used for building dev and stable releases of Go code
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `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](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

#### `go-ci-unstable-build`

Expand All @@ -354,6 +387,7 @@ the latest version in the current stable series.
- used for building dev and stable releases of Go code
- ✔️ provides multiple [custom build tools](#build-tools-included)
- ❌ does not include [linters](#linting-tools-included)
- ❌ does not include [testing tools](#testing-tools-included)

## Examples / How to use these images

Expand All @@ -380,9 +414,9 @@ official release is also provided for further review.
- for building images
- `make`
- if using the provided `Makefile`
- At *least* 10 GB free disk space
- if building all images
- 15+ GB free disk space recommended
- 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

Expand All @@ -398,12 +432,12 @@ official release is also provided for further review.
- [`orijtech/tickeryzer`](https://github.com/orijtech/tickeryzer)
- [pelletier/go-toml](https://github.com/pelletier/go-toml)
- [fatih/errwrap](https://github.com/fatih/errwrap)

- Build Tools
- [tc-hib/go-winres](https://github.com/tc-hib/go-winres)
- [goreleaser/nfpm](https://github.com/goreleaser/nfpm)
- [choffmeister/git-describe-semver](https://github.com/choffmeister/git-describe-semver)

- Testing Tools
- [`bitfield/gotestdox`](https://github.com/bitfield/gotestdox)
- Images
- <https://fabianlee.org/2020/01/26/golang-using-multi-stage-builds-to-create-clean-docker-images/>
- <https://hub.docker.com/r/golangci/golangci-lint>
Expand Down
3 changes: 3 additions & 0 deletions oldstable/combined/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ENV STRUCTSLOP_VERSION="v0.0.8"
ENV TICKERYZER_VERSION="v0.0.3"
ENV TOMLL_VERSION="v2.2.0"
ENV ERRWRAP_VERSION="v1.6.0"
ENV GOTESTDOX_VERSION="v0.2.2"

ENV APT_BSDMAINUTILS_VERSION="12.1.8"
ENV APT_TREE_VERSION="2.1.0-1"
Expand All @@ -53,6 +54,8 @@ RUN apt-get update \
&& go install golang.org/x/vuln/cmd/govulncheck@${GOVULNCHECK_VERSION} \
&& echo "Installing deadcode@${DEADCODE_VERSION}" \
&& go install golang.org/x/tools/cmd/deadcode@${DEADCODE_VERSION} \
&& echo "Installing gotestdox@${GOTESTDOX_VERSION}" \
&& go install github.com/bitfield/gotestdox/cmd/gotestdox@${GOTESTDOX_VERSION} \
&& echo "Installing golangci-lint ${GOLANGCI_LINT_VERSION}" \
&& curl -sSfLO https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
&& sh install.sh -b "$(go env GOPATH)/bin" ${GOLANGCI_LINT_VERSION} \
Expand Down
7 changes: 6 additions & 1 deletion stable/combined/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENV STRUCTSLOP_VERSION="v0.0.8"
ENV TICKERYZER_VERSION="v0.0.3"
ENV TOMLL_VERSION="v2.2.0"
ENV ERRWRAP_VERSION="v1.6.0"
ENV GOTESTDOX_VERSION="v0.2.2"

# These commits/versions are provided by temporary forks of the upstream
# projects. The plan is to switch back to current upstream vesions once
Expand Down Expand Up @@ -58,7 +59,9 @@ RUN echo "Installing govulncheck@${GOVULNCHECK_VERSION}" \
&& echo "Installing deadcode@${DEADCODE_VERSION}" \
&& go install golang.org/x/tools/cmd/deadcode@${DEADCODE_VERSION} \
&& echo "Installing tomll@${TOMLL_VERSION}" \
&& go install github.com/pelletier/go-toml/v2/cmd/tomll@${TOMLL_VERSION}
&& go install github.com/pelletier/go-toml/v2/cmd/tomll@${TOMLL_VERSION} \
&& echo "Installing gotestdox@${GOTESTDOX_VERSION}" \
&& go install github.com/bitfield/gotestdox/cmd/gotestdox@${GOTESTDOX_VERSION}

RUN echo "Installing httperroryzer from temporary fork" \
&& git clone https://github.com/atc0005/httperroryzer \
Expand Down Expand Up @@ -132,6 +135,7 @@ ENV STRUCTSLOP_VERSION="v0.0.8"
ENV TICKERYZER_VERSION="v0.0.3"
ENV TOMLL_VERSION="v2.2.0"
ENV ERRWRAP_VERSION="v1.6.0"
ENV GOTESTDOX_VERSION="v0.2.2"

ENV APT_BSDMAINUTILS_VERSION="12.1.8"
ENV APT_TREE_VERSION="2.1.0-1"
Expand All @@ -147,6 +151,7 @@ COPY --from=builder /go/bin/staticcheck /usr/bin/staticcheck
COPY --from=builder /go/bin/golangci-lint /usr/bin/golangci-lint
COPY --from=builder /go/bin/govulncheck /usr/bin/govulncheck
COPY --from=builder /go/bin/deadcode /usr/bin/deadcode
COPY --from=builder /go/bin/gotestdox /usr/bin/gotestdox
COPY --from=builder /go/bin/httperroryzer /usr/bin/httperroryzer
COPY --from=builder /go/bin/structslop /usr/bin/structslop
COPY --from=builder /go/bin/tickeryzer /usr/bin/tickeryzer
Expand Down
5 changes: 5 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ module github.com/atc0005/go-ci/tools
go 1.19

require (
// govulncheck - provided as an optional testing utility
// https://pkg.go.dev/github.com/bitfield/gotestdox?tab=versions
// https://github.com/bitfield/gotestdox
github.com/bitfield/gotestdox v0.2.2

// errwrap - provided as an optional linter
github.com/fatih/errwrap v1.6.0

Expand Down
Loading

0 comments on commit 01baba5

Please sign in to comment.