mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Merge pull request #285 from crazy-max/test-target
chore: use same target for sandboxed and native tests
This commit is contained in:
@@ -95,14 +95,13 @@ jobs:
|
|||||||
echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
|
echo -e "trust\n5\ny" | gpg --batch --no-tty --command-fd 0 --edit-key 7D851EB72D73BDA0
|
||||||
pass init 7D851EB72D73BDA0
|
pass init 7D851EB72D73BDA0
|
||||||
fi
|
fi
|
||||||
go test -short -v -coverprofile=./coverage.txt -covermode=atomic ./...
|
make test COVERAGEDIR=${{ env.DESTDIR }}
|
||||||
go tool cover -func=./coverage.txt
|
|
||||||
shell: bash
|
shell: bash
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
file: ./coverage.txt
|
file: ${{ env.DESTDIR }}/coverage.txt
|
||||||
|
|
||||||
test-sandboxed:
|
test-sandboxed:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|||||||
+2
-2
@@ -86,8 +86,8 @@ RUN --mount=type=bind,target=. \
|
|||||||
gpg -k
|
gpg -k
|
||||||
|
|
||||||
mkdir /out
|
mkdir /out
|
||||||
xx-go test -short -v -coverprofile=/out/coverage.txt -covermode=atomic ./...
|
xx-go --wrap
|
||||||
xx-go tool cover -func=/out/coverage.txt
|
make test COVERAGEDIR=/out
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ GO_LDFLAGS = -s -w -X ${GO_PKG}/credentials.Version=${VERSION} -X ${GO_PKG}/cred
|
|||||||
|
|
||||||
BUILDX_CMD ?= docker buildx
|
BUILDX_CMD ?= docker buildx
|
||||||
DESTDIR ?= ./bin/build
|
DESTDIR ?= ./bin/build
|
||||||
|
COVERAGEDIR ?= ./bin/coverage
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: cross
|
all: cross
|
||||||
@@ -35,8 +36,10 @@ release: # create release
|
|||||||
./hack/release
|
./hack/release
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: # tests all packages except vendor
|
test:
|
||||||
go test -v `go list ./... | grep -v /vendor/`
|
mkdir -p $(COVERAGEDIR)
|
||||||
|
go test -short -v -coverprofile=$(COVERAGEDIR)/coverage.txt -covermode=atomic ./...
|
||||||
|
go tool cover -func=$(COVERAGEDIR)/coverage.txt
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
|
|||||||
Reference in New Issue
Block a user