diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b976dcc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +coverage +.git +.idea diff --git a/.gitignore b/.gitignore index 404abb2..77edd20 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -coverage/ +/coverage +/.idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2f6c6a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM golang:1.17.1 + +ADD . /app +WORKDIR /app diff --git a/Makefile b/Makefile index 4f844f4..85dee7e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,15 @@ -SHELL = bash +SHELL := /bin/bash .PHONY: coverage 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: [[ -d coverage ]] || mkdir coverage go test -coverpkg=./... -coverprofile=coverage/index.out ./...