Minor changes parametrizing the Makefile and CircleCI config.
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
# Golang CircleCI 2.0 configuration file
|
||||||
|
#
|
||||||
|
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
docker:
|
||||||
|
- image: circleci/golang:1.9
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run: make
|
||||||
|
- persist_to_workspace:
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
- output
|
||||||
|
spec_check:
|
||||||
|
docker:
|
||||||
|
- image: bbvalabsci/kapow-spec-test-suite:latest
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- run: install /tmp/workspace/build/kapow /usr/bin
|
||||||
|
- run: behave
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build_and_test:
|
||||||
|
jobs:
|
||||||
|
- build
|
||||||
|
- spec_check
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
+3
-1
@@ -1,2 +1,4 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
coverage.html
|
|
||||||
|
output
|
||||||
|
build
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
.PHONY: test install acceptance deps
|
.PHONY: build test coverage install acceptance deps
|
||||||
|
|
||||||
all: acceptance
|
GOCMD=go
|
||||||
|
GOBUILD=$(GOCMD) build
|
||||||
|
GOGET=$(GOCMD) get
|
||||||
|
GOTEST=$(GOCMD) test
|
||||||
|
GOTOOL=$(GOCMD) tool
|
||||||
|
|
||||||
test: deps
|
BUILD_DIR=./build
|
||||||
go test -race -coverprofile=/tmp/c.out github.com/BBVA/kapow/pkg/...
|
OUTPUT_DIR=./output
|
||||||
go tool cover -html=/tmp/c.out -o coverage.html
|
TMP_DIR=/tmp
|
||||||
|
|
||||||
install: test
|
BINARY_NAME=kapow
|
||||||
go install github.com/BBVA/kapow/...
|
|
||||||
|
all: test build
|
||||||
|
|
||||||
|
build: deps
|
||||||
|
mkdir -p $(BUILD_DIR)
|
||||||
|
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v
|
||||||
|
|
||||||
|
test: build
|
||||||
|
$(GOTEST) -race -coverprofile=$(TMP_DIR)/c.out ./...
|
||||||
|
|
||||||
|
coverage: test
|
||||||
|
mkdir -p $(OUTPUT_DIR)
|
||||||
|
$(GOTOOL) cover -html=$(TMP_DIR)/c.out -o $(OUTPUT_DIR)/coverage.html
|
||||||
|
|
||||||
|
install: build
|
||||||
|
go install ./...
|
||||||
|
|
||||||
acceptance: install
|
acceptance: install
|
||||||
make -C spec/test
|
make -C ./spec/test
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
@echo "deps here"
|
@echo "deps here"
|
||||||
|
|||||||
Reference in New Issue
Block a user