File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,13 @@ jobs:
95
95
echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
96
96
pass init 7D851EB72D73BDA0
97
97
fi
98
- go test -short -v -coverprofile=./coverage.txt -covermode=atomic ./...
99
- go tool cover -func=./coverage.txt
98
+ make test COVERAGEDIR=${{ env.DESTDIR }}
100
99
shell : bash
101
100
-
102
101
name : Upload coverage
103
102
uses : codecov/codecov-action@v3
104
103
with :
105
- file : . /coverage.txt
104
+ file : ${{ env.DESTDIR }} /coverage.txt
106
105
107
106
test-sandboxed :
108
107
runs-on : ubuntu-22.04
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ RUN --mount=type=bind,target=. \
86
86
gpg -k
87
87
88
88
mkdir /out
89
- xx-go test -short -v -coverprofile=/out/coverage.txt -covermode=atomic ./...
90
- xx-go tool cover -func =/out/coverage.txt
89
+ xx-go --wrap
90
+ make test COVERAGEDIR =/out
91
91
EOT
92
92
93
93
FROM scratch AS test-coverage
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/cred
7
7
8
8
BUILDX_CMD ?= docker buildx
9
9
DESTDIR ?= ./bin/build
10
+ COVERAGEDIR ?= ./bin/coverage
10
11
11
12
.PHONY : all
12
13
all : cross
@@ -35,8 +36,10 @@ release: # create release
35
36
./hack/release
36
37
37
38
.PHONY : test
38
- test : # tests all packages except vendor
39
- go test -v ` go list ./... | grep -v /vendor/`
39
+ test :
40
+ mkdir -p $(COVERAGEDIR )
41
+ go test -short -v -coverprofile=$(COVERAGEDIR ) /coverage.txt -covermode=atomic ./...
42
+ go tool cover -func=$(COVERAGEDIR ) /coverage.txt
40
43
41
44
.PHONY : lint
42
45
lint :
You can’t perform that action at this time.
0 commit comments