Skip to content

Commit feabcee

Browse files
committed
leverage makefile to run build tasks
remove circle ci
1 parent bf26895 commit feabcee

File tree

5 files changed

+73
-66
lines changed

5 files changed

+73
-66
lines changed

.circleci/config.yml

-53
This file was deleted.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Session.vim
3232
tags
3333

3434
*.exe
35-
cobra
3635
cobra.test
36+
bin
3737

3838
.idea/
3939
*.iml

.travis.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@ language: go
33
stages:
44
- diff
55
- test
6+
- build
67

78
go:
8-
- 1.10.x
9-
- 1.11.x
109
- 1.12.x
10+
- 1.13.x
1111
- tip
1212

13+
before_install:
14+
- go get -u github.com/kyoh86/richgo
15+
- go get -u github.com/mitchellh/gox
16+
1317
matrix:
1418
allow_failures:
1519
- go: tip
1620
include:
1721
- stage: diff
18-
go: 1.12.x
19-
script: diff -u <(echo -n) <(gofmt -d -s .)
20-
21-
before_install: go get -u github.com/kyoh86/richgo
22+
go: 1.13.x
23+
script: make fmt
24+
- stage: build
25+
go: 1.13.x
26+
script: make cobra_generator
2227

23-
script:
24-
- richgo test -v ./...
25-
- go build
26-
- if [ -z $NOVET ]; then
27-
diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
28-
fi
28+
script:
29+
- make test

Makefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
BIN="./bin"
2+
SRC=$(shell find . -name "*.go")
3+
4+
ifeq (, $(shell which richgo))
5+
$(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo")
6+
endif
7+
8+
.PHONY: fmt vet test cobra_generator install_deps clean
9+
10+
default: all
11+
12+
all: fmt vet test cobra_generator
13+
14+
fmt:
15+
$(info ******************** checking formatting ********************)
16+
@test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1)
17+
18+
test: install_deps vet
19+
$(info ******************** running tests ********************)
20+
richgo test -v ./...
21+
22+
cobra_generator: install_deps
23+
$(info ******************** building generator ********************)
24+
mkdir -p $(BIN)
25+
make -C cobra all
26+
27+
install_deps:
28+
$(info ******************** downloading dependencies ********************)
29+
go get -v ./...
30+
31+
vet:
32+
$(info ******************** vetting ********************)
33+
go vet ./...
34+
35+
clean:
36+
rm -rf $(BIN)

cobra/Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
XC_OS="linux darwin"
2+
XC_ARCH="amd64"
3+
XC_PARALLEL="2"
4+
BIN="../bin"
5+
SRC=$(shell find . -name "*.go")
6+
7+
ifeq (, $(shell which gox))
8+
$(warning "could not find gox in $(PATH), run: go get github.com/mitchellh/gox")
9+
endif
10+
11+
.PHONY: all build
12+
13+
default: all
14+
15+
all: build
16+
17+
build:
18+
gox \
19+
-os=$(XC_OS) \
20+
-arch=$(XC_ARCH) \
21+
-parallel=$(XC_PARALLEL) \
22+
-output=$(BIN)/{{.Dir}}_{{.OS}}_{{.Arch}} \
23+
;

0 commit comments

Comments
 (0)