You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It leverages a go binary built with coverage instrumentation using
the -cover build flag alongside its coverage data genreated to produce
a statements by functions based report via the go tool covdata.
Signed-off-by: Massimiliano Giovagnoli <massimiliano.giovagnoli@chainguard.dev>
Copy file name to clipboardexpand all lines: pkg/build/pipelines/go/README.md
+15-2
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
+
1
2
<!-- start:pipeline-reference-gen -->
2
3
# Pipeline Reference
3
4
4
5
5
6
-[go/build](#gobuild)
6
7
-[go/bump](#gobump)
8
+
-[go/covdata](#gocovdata)
7
9
-[go/install](#goinstall)
8
10
9
11
## go/build
@@ -19,7 +21,7 @@ Run a build using the go compiler
19
21
| buildmode | false | The -buildmode flag value. See "go help buildmode" for more information. | default |
20
22
| deps | false | space separated list of go modules to update before building. example: github.com/foo/bar@v1.2.3 ||
21
23
| experiments | false | A comma-separated list of Golang experiment names (ex: loopvar) to use when building the binary. ||
22
-
| extra-args | false | A space-separated list of extra arguments for go build command. ||
24
+
| extra-args | false | A space-separated list of extra arguments to pass to the go build command. ||
23
25
| go-package | false | The go package to install | go |
24
26
| install-dir | false | Directory where binaries will be installed | bin |
25
27
| ldflags | false | List of [pattern=]arg to append to the go compiler with -ldflags ||
@@ -49,6 +51,17 @@ Bump go deps to a certain version
49
51
| tidy | false | Run go mod tidy command before and after the bump | true |
50
52
| tidy-compat | false | Set the go version for which the tidied go.mod and go.sum files should be compatible ||
51
53
54
+
## go/covdata
55
+
56
+
Get coverage data with the covdata go tool
57
+
58
+
### Inputs
59
+
60
+
| Name | Required | Description | Default |
61
+
| ---- | -------- | ----------- | ------- |
62
+
| cover-dir | false | The GOCOVERDIR path where coverage data files have been generated. It's required to be set as environment variable as well before running the Go binary. | /home/build |
63
+
| package | false | The go package to install | go |
64
+
52
65
## go/install
53
66
54
67
Run a build using the go compiler
@@ -71,4 +84,4 @@ Run a build using the go compiler
71
84
| version | false | Package version to install. This can be a version tag (v1.0.0), a commit hash or another ref (eg latest or HEAD). ||
# Leave go off here, some packages pin to an older version. Let's just assume this gets injected elsewhere.
4
+
needs:
5
+
packages:
6
+
- ${{inputs.package}}
7
+
- busybox
8
+
9
+
inputs:
10
+
package:
11
+
description: The go package to install
12
+
default: go
13
+
cover-dir:
14
+
description: The GOCOVERDIR path where coverage data files have been generated. It's required to be set as environment variable as well before running the Go binary.
0 commit comments