mirror of
https://github.com/h44z/wg-portal.git
synced 2026-04-06 23:46:22 +00:00
Add test-in-docker target to Makefile (#659)
* Add test-in-docker target to Makefile Add a target to run tests in Docker for non-Linux environments. * Add GOVERSION variable to Makefile * fix: update test-in-docker command to use user permissions * Fix docker command syntax in Makefile
This commit is contained in:
8
Makefile
8
Makefile
@@ -1,7 +1,8 @@
|
||||
# Go parameters
|
||||
GOCMD=go
|
||||
GOVERSION=1.25
|
||||
MODULENAME=github.com/h44z/wg-portal
|
||||
GOFILES:=$(shell go list ./... | grep -v /vendor/)
|
||||
GOFILES=$(shell go list ./... | grep -v /vendor/)
|
||||
BUILDDIR=dist
|
||||
BINARIES=$(subst cmd/,,$(wildcard cmd/*))
|
||||
IMAGE=h44z/wg-portal
|
||||
@@ -51,6 +52,11 @@ format:
|
||||
.PHONY: test
|
||||
test: test-vet test-race
|
||||
|
||||
#> test-in-docker: Run tests in Docker (for non-Linux environments e.g. MacOS)
|
||||
.PHONY: test-in-docker
|
||||
test-in-docker:
|
||||
docker run --rm -u $(shell id -u):$(shell id -g) -e HOME=/tmp -v $(PWD):/app -w /app golang:$(GOVERSION) make test
|
||||
|
||||
#< test-vet: Static code analysis
|
||||
.PHONY: test-vet
|
||||
test-vet: build-dependencies
|
||||
|
||||
Reference in New Issue
Block a user