Add ci-coverage make target to build coverage in a container

master
Buddy Sandidge 3 years ago
parent 1ae130ff97
commit 378f676c72

@ -0,0 +1,3 @@
coverage
.git
.idea

3
.gitignore vendored

@ -1 +1,2 @@
coverage/ /coverage
/.idea

@ -0,0 +1,4 @@
FROM golang:1.17.1
ADD . /app
WORKDIR /app

@ -1,10 +1,15 @@
SHELL = bash SHELL := /bin/bash
.PHONY: coverage .PHONY: coverage
test: test:
go test ./... go test ./...
ci-coverage:
[[ -d coverage ]] || mkdir coverage
podman build --tag tmpl-coverage .
podman run --interactive --tty --rm --volume $$(pwd)/coverage:/app/coverage tmpl-coverage make coverage
coverage: coverage:
[[ -d coverage ]] || mkdir coverage [[ -d coverage ]] || mkdir coverage
go test -coverpkg=./... -coverprofile=coverage/index.out ./... go test -coverpkg=./... -coverprofile=coverage/index.out ./...

Loading…
Cancel
Save