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:
9595 echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
9696 pass init 7D851EB72D73BDA0
9797 fi
98- go test -short -v -coverprofile=./coverage.txt -covermode=atomic ./...
99- go tool cover -func=./coverage.txt
98+ make test COVERAGEDIR=${{ env.DESTDIR }}
10099 shell : bash
101100 -
102101 name : Upload coverage
103102 uses : codecov/codecov-action@v3
104103 with :
105- file : . /coverage.txt
104+ file : ${{ env.DESTDIR }} /coverage.txt
106105
107106 test-sandboxed :
108107 runs-on : ubuntu-22.04
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ RUN --mount=type=bind,target=. \
8686 gpg -k
8787
8888 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
9191EOT
9292
9393FROM 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
77
88BUILDX_CMD ?= docker buildx
99DESTDIR ?= ./bin/build
10+ COVERAGEDIR ?= ./bin/coverage
1011
1112.PHONY : all
1213all : cross
@@ -35,8 +36,10 @@ release: # create release
3536 ./hack/release
3637
3738.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
4043
4144.PHONY : lint
4245lint :
You can’t perform that action at this time.
0 commit comments