Newer
Older
{
"name": "Go",
"description": "Build and test with [Go](https://golang.org/).",
"template_path": "templates/gitlab-ci-golang.yml",
"kind": "build",
"variables": [
{
"name": "GO_IMAGE",
"description": "The Docker image used to run Go (build+test or build only) - **set the version required by your project**",
"default": "golang:buster"
},
{
"name": "GOPROXY",
"description": "URL of Go module proxy (see [Go env](https://golang.org/cmd/go/#hdr-Environment_variables))",
"advanced": true
},
{
"name": "GO_TEST_IMAGE",
"description": "Specific Docker image used to run Go tests (as a separate job)",
"advanced": true
},
{
"name": "GO_TEST_ARGS",
"description": "Arguments used by the test command",
"default": "test -mod=readonly -v -coverprofile=reports/coverage.out -race ./...",
"advanced": true
},
{
"name": "GO_LIST_ARGS",
"description": "Arguments used by the list command",
"default": "list -u -m -mod=readonly -json all",
"advanced": true
}
],
"features": [
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
"id": "go-build",
"name": "go build",
"description": "[go build](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies)",
"variables": [
{
"name": "GO_BUILD_FLAGS",
"description": "Flags used by the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies)",
"default": "-mod=readonly",
"advanced": true
},
{
"name": "GO_BUILD_PACKAGES",
"description": "Packages to build with the [go build command](https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies)",
"default": "./...",
"advanced": true
},
{
"name": "GO_TARGET_OS",
"description": "The `$GOOS` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63)\n\nFallbacks to default `$GOOS` from the Go Docker image",
"advanced": true
},
{
"name": "GO_TARGET_ARCH",
"description": "The `$GOARCH` target [see available values](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63)\n\nFallbacks to default `$GOARCH` from the Go Docker image",
"advanced": true
}
]
},
{
"id": "go-test",
"name": "go test",
"description": "[go test](https://pkg.go.dev/cmd/go#hdr-Test_packages)",
"variables": [
{
"name": "GO_TEST_FLAGS",
"description": "Flags used by the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages)",
"default": "-mod=readonly -v -race",
"advanced": true
},
{
"name": "GO_TEST_PACKAGES",
"description": "Packages to test with the [go test command](https://pkg.go.dev/cmd/go#hdr-Test_packages)",
"default": "./...",
"advanced": true
}
]
},
{
"id": "golangci-lint",
"name": "GolangCI-Lint",
"description": "[GolangCI-Lint](https://github.com/golangci/golangci-lint) analysis",
"disable_with": "GO_CI_LINT_DISABLED",
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
"variables": [
{
"name": "GO_CI_LINT_IMAGE",
"description": "The Docker image used to run `golangci-lint`",
"default": "golangci/golangci-lint:latest-alpine"
},
{
"name": "GO_CI_LINT_ARGS",
"description": "`golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options)",
"default": "-E gosec,goimports ./...",
"advanced": true
}
]
},
{
"id": "go-mod-outdated",
"name": "Go-mod-outdated",
"description": "[Go-mod-outdated](https://github.com/psampaz/go-mod-outdated) analysis",
"variables": [
{
"name": "GO_MOD_OUTDATED_ARGS",
"description": "`god-mod-outdated` [command line arguments](https://github.com/psampaz/go-mod-outdated#usage",
"default": "-update -direct -style markdown -ci",
"advanced": true
}
]
}
]
}