Skip to content

Commit 81caa95

Browse files
authored
Merge pull request #26 from zencoder/circle_v2
CircleCI v2
2 parents 226c58c + 56249a7 commit 81caa95

File tree

3 files changed

+61
-53
lines changed

3 files changed

+61
-53
lines changed

.circleci/config.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
version: 2
3+
executorType: docker
4+
containerInfo:
5+
- image: library/golang
6+
environment:
7+
AWS_ACCESS_KEY_ID: 1
8+
AWS_SECRET_ACCESS_KEY: 1
9+
GLIDE_VERSION: 0.12.3
10+
jobs:
11+
build:
12+
workdir: "/go/src/github.com/zencoder/go-remote-config"
13+
steps:
14+
- checkout
15+
- run:
16+
name: Install Glide
17+
command: |
18+
set -eux
19+
curl -sSLfO https://github.com/Masterminds/glide/releases/download/v${GLIDE_VERSION}/glide-v${GLIDE_VERSION}-linux-amd64.tar.gz
20+
mkdir glide
21+
tar -xzf glide-v${GLIDE_VERSION}-linux-amd64.tar.gz -C ./glide
22+
cp ./glide/linux-amd64/glide /usr/local/bin/glide
23+
rm -r glide glide-v${GLIDE_VERSION}-linux-amd64.tar.gz
24+
- restore_cache:
25+
key: glide-{{ checksum "glide.lock" }}
26+
- run:
27+
name: Download vendored Go dependencies
28+
command: glide install
29+
- save_cache:
30+
key: glide-{{ checksum "glide.lock" }}
31+
paths:
32+
- vendor
33+
- run:
34+
name: Install required tooling
35+
command: |
36+
go get golang.org/x/tools/cmd/cover
37+
go get github.com/mattn/goveralls
38+
go get github.com/modocache/gover
39+
- run:
40+
name: Run unit tests
41+
command: |
42+
make test
43+
- run:
44+
name: Collect coverage reports
45+
command: |
46+
make cover
47+
- run:
48+
name: Submit coverage to coveralls.io
49+
command: |
50+
make coveralls

Makefile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
GO15VENDOREXPERIMENT := 1
2-
31
COVERAGEDIR = coverage
42
ifdef CIRCLE_ARTIFACTS
53
COVERAGEDIR = $(CIRCLE_ARTIFACTS)
64
endif
75

8-
all: build test cover
6+
ifdef VERBOSE
7+
V = -v
8+
else
9+
.SILENT:
10+
endif
11+
912
install-deps:
10-
glide install
13+
glide install
1114
build:
12-
if [ ! -d bin ]; then mkdir bin; fi
13-
go build -v -o bin/go-remote-config
15+
mkdir -p bin
16+
go build $(V) -o bin/go-remote-config
1417
fmt:
1518
go fmt ./...
1619

1720
test: export AWS_ACCESS_KEY_ID := 1
1821
test: export AWS_SECRET_ACCESS_KEY := 1
1922
test:
20-
if [ ! -d coverage ]; then mkdir coverage; fi
21-
go test -v ./ -race -cover -coverprofile=$(COVERAGEDIR)/remoteconfig.coverprofile
23+
mkdir -p coverage
24+
go test $(V) ./ -race -cover -coverprofile=$(COVERAGEDIR)/remoteconfig.coverprofile
2225
cover:
2326
go tool cover -html=$(COVERAGEDIR)/remoteconfig.coverprofile -o $(COVERAGEDIR)/remoteconfig.html
24-
tc: test cover
2527
coveralls:
2628
gover $(COVERAGEDIR) $(COVERAGEDIR)/coveralls.coverprofile
2729
goveralls -coverprofile=$(COVERAGEDIR)/coveralls.coverprofile -service=circle-ci -repotoken=$(COVERALLS_TOKEN)

circle.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)