diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-12-07 19:32:50 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-12-08 18:00:58 +0300 |
commit | ebc6f22795841278dcde08877ec12d782e0f79a1 (patch) | |
tree | 9539f23052c124be4ee484b9d50cc6c7ef223c85 | |
parent | b0b823ec44c112834e0fe930e13fdaa5b1929535 (diff) |
Adapt Makefile test recipe to work on CI
Mostly copied from gitlab-workhorse Makefile, kudos to the authors!
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore index e65d5acfc..0c79371f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ client/testdata/data +_build @@ -1,9 +1,23 @@ +PKG=gitlab.com/gitlab-org/git-access-daemon +BUILD_DIR = $(shell pwd) + +export GOPATH:=$(GOPATH):${BUILD_DIR}/_build + all: test build build: go build -o git-daemon-server cmd/server/main.go go build -o git-daemon-client cmd/client/main.go -test: - cd server && go test - cd client && go test +${BUILD_DIR}/_build: + mkdir -p $@/src/${PKG} + tar -cf - --exclude _build --exclude .git . | (cd $@/src/${PKG} && tar -xf -) + touch $@ + +test: ${BUILD_DIR}/_build + cd ${BUILD_DIR}/_build/src/${PKG}/server && go test + cd ${BUILD_DIR}/_build/src/${PKG}/client && go test + +clean: + rm -rf ${BUILD_DIR}/_build + rm -rf client/testdata |