| `GO_IMAGE`| The Docker image used to run Go for `go-build`<br/>:warning: **set the version required by your project** | `registry.hub.docker.com/library/golang:buster` |
| `GO_TEST_IMAGE`| The Docker image used to run Go for `go-test`<br/>:warning: **set the version required by your project** | _none_ |
| `GO_PROJECT_DIR` | Go project root directory | `.` |
| `GOPROXY`| URL of Go module proxy | _none_ |
| `image` / `GO_IMAGE` | The Docker image used to run Go for `go-build`<br/>:warning: **set the version required by your project** | `registry.hub.docker.com/library/golang:bookworm` |
| `test-image` / `GO_TEST_IMAGE` | The Docker image used to run Go for `go-test`<br/>:warning: **set the version required by your project** | _none_ |
| `GO_BUILD_MODE`| The template build mode (accepted values are `application`, `modules` and `auto`) | `auto` |
| `GO_BUILD_FLAGS`| Flags used by the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies) | `-mod=readonly` |
| `GO_BUILD_LINKER_FLAGS` | Linker flags used by the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies)`-ldflags` | `-s -w` |
| `GO_BUILD_PACKAGES`| Packages to build with the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies) | `./...` |
| `GO_TEST_FLAGS`| Flags used by the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages) | `-mod=readonly -v -race` |
| `GO_TEST_PACKAGES`| Packages to test with the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages) | `./...` |
| `GO_LIST_ARGS`| Arguments used by the list command | `list -u -m -mod=readonly -json all` |
| `GO_TARGET_OS`| The `GOOS` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) | _none_ (fallback to go docker image `GOOS`) |
| `GO_TARGET_ARCH`| The `GOARCH` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) | _none_ (fallback to go docker image `GOARCH`) |
| `GO_COBERTURA_FLAGS`| The `GOFLAGS` to use with `gocover-cobertura` if needed | _none_ |
| `build-mode` / `GO_BUILD_MODE` | The template build mode (accepted values are `application`, `modules` and `auto`) | `auto` |
| `build-flags` / `GO_BUILD_FLAGS` | Flags used by the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies) | `-mod=readonly` |
| `build-linker-flags` / `GO_BUILD_LINKER_FLAGS` | Linker flags used by the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies)`-ldflags` | `-s -w` |
| `build-packages` / `GO_BUILD_PACKAGES` | Packages to build with the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies) | `./...` |
| `test-flags` / `GO_TEST_FLAGS` | Flags used by the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages) | `-mod=readonly -v -race` |
| `test-packages` / `GO_TEST_PACKAGES` | Packages to test with the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages) | `./...` |
| `list-args` / `GO_LIST_ARGS` | Arguments used by the list command | `list -u -m -mod=readonly -json all` |
| `target-os` / `GO_TARGET_OS` | The `GOOS` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) | _none_ (fallback to go docker image `GOOS`) |
| `target-arch` / `GO_TARGET_ARCH` | The `GOARCH` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) | _none_ (fallback to go docker image `GOARCH`) |
| `cobertura-flags` / `GO_COBERTURA_FLAGS` | The `GOFLAGS` to use with `gocover-cobertura` if needed | _none_ |
In addition to a textual report in the console, the test jobs produce the following reports, kept for one day:
@@ -97,11 +120,11 @@ This job enables a manual [GolangCI-Lint](https://github.com/golangci/golangci-l
It is bound to the `build` stage, and uses the following variables:
| Name | Description | Default value |
| Input / Variable | Description | Default value |
| `GO_CI_LINT_IMAGE`| The Docker image used to run `golangci-lint` | `registry.hub.docker.com/golangci/golangci-lint:latest-alpine` |
| `GO_CI_LINT_ARGS`| `golangci-lint`[command line arguments](https://github.com/golangci/golangci-lint#command-line-options) | `-E gosec,goimports ./...` |
| `GO_CI_LINT_DISABLED` | Set to `true` to disable this job | _none_(enabled) |
| `ci-lint-image` / `GO_CI_LINT_IMAGE` | The Docker image used to run `golangci-lint` | `registry.hub.docker.com/golangci/golangci-lint:latest-alpine` |
| `GO_SBOM_DISABLED` | Set to `true` to disable this job | _none_ |
| `GO_SBOM_IMAGE` | Image of cyclonedx-gomod used for SBOM analysis | `registry.hub.docker.com/cyclonedx/cyclonedx-gomod:latest` |
| `GO_SBOM_OPTS` | [@cyclonedx/cyclonedx-gomod options](https://github.com/CycloneDX/cyclonedx-gomod#usage) used for SBOM analysis | `-main .` |
| `sbom-disabled` / `GO_SBOM_DISABLED` | Set to `true` to disable this job | _none_ |
| `sbom-image` / `GO_SBOM_IMAGE` | Image of cyclonedx-gomod used for SBOM analysis | `registry.hub.docker.com/cyclonedx/cyclonedx-gomod:latest` |
| `sbom-opts` / `GO_SBOM_OPTS` | [@cyclonedx/cyclonedx-gomod options](https://github.com/CycloneDX/cyclonedx-gomod#usage) used for SBOM analysis | `-main .` |
:warning: if you don't have your main class located at the root of your `GO_PROJECT_DIR`, then you will need to override the `-main` option in `GO_SBOM_OPTS` and define your real main class location.
@@ -182,7 +205,7 @@ This job enables Vulnerability Management with [Govulncheck](https://go.dev/blog
It is bound to the `test` stage, and uses the following variables:
| Name | Description | Default value |
| Input / Variable | Description | Default value |