Skip to content

Commit 974fc53

Browse files
stuarthickstheocodes
authored andcommitted
migrate to go modules (#27)
1 parent 81caa95 commit 974fc53

File tree

6 files changed

+42
-74
lines changed

6 files changed

+42
-74
lines changed

.circleci/config.yml

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,26 @@
11
---
22
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
103
jobs:
114
build:
12-
workdir: "/go/src/github.com/zencoder/go-remote-config"
5+
docker:
6+
- image: circleci/golang
137
steps:
148
- 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
249
- restore_cache:
25-
key: glide-{{ checksum "glide.lock" }}
10+
key: go-mod-{{ checksum "go.sum" }}
2611
- run:
27-
name: Download vendored Go dependencies
28-
command: glide install
12+
name: Download Go dependencies
13+
command: go mod download
2914
- save_cache:
30-
key: glide-{{ checksum "glide.lock" }}
15+
key: go-mod-{{ checksum "go.sum" }}
3116
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
17+
- /go/pkg/mod
3918
- run:
4019
name: Run unit tests
4120
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
21+
make
22+
experimental:
23+
notify:
24+
branches:
25+
only:
26+
- master

Makefile

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
COVERAGEDIR = coverage
2-
ifdef CIRCLE_ARTIFACTS
3-
COVERAGEDIR = $(CIRCLE_ARTIFACTS)
4-
endif
1+
# Force-enable Go modules even if this project has been cloned within a user's GOPATH
2+
export GO111MODULE = on
53

4+
# Specify VERBOSE=1 to get verbose output from all executed commands
65
ifdef VERBOSE
76
V = -v
7+
X = -x
88
else
99
.SILENT:
1010
endif
1111

12-
install-deps:
13-
glide install
12+
.PHONY: all
13+
all: build test
14+
15+
.PHONY: clean
16+
clean:
17+
rm -rf bin/ coverage/ cucumber/logs/
18+
go clean -i $(X) -cache -testcache
19+
20+
.PHONY: build
1421
build:
1522
mkdir -p bin
16-
go build $(V) -o bin/go-remote-config
23+
go build $(V) -o bin/gokay
24+
25+
.PHONY: fmt
1726
fmt:
18-
go fmt ./...
27+
go fmt $(X) ./...
1928

20-
test: export AWS_ACCESS_KEY_ID := 1
21-
test: export AWS_SECRET_ACCESS_KEY := 1
29+
.PHONY: test
2230
test:
2331
mkdir -p coverage
24-
go test $(V) ./ -race -cover -coverprofile=$(COVERAGEDIR)/remoteconfig.coverprofile
32+
go test $(V) -race -cover -coverprofile coverage/cover.profile ./...
33+
34+
.PHONY: cover
2535
cover:
26-
go tool cover -html=$(COVERAGEDIR)/remoteconfig.coverprofile -o $(COVERAGEDIR)/remoteconfig.html
27-
coveralls:
28-
gover $(COVERAGEDIR) $(COVERAGEDIR)/coveralls.coverprofile
29-
goveralls -coverprofile=$(COVERAGEDIR)/coveralls.coverprofile -service=circle-ci -repotoken=$(COVERALLS_TOKEN)
30-
clean:
31-
go clean
32-
rm -f bin/go-remote-config
33-
rm -rf coverage/
36+
go tool cover -html coverage/cover.profile

glide.lock

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

glide.yaml

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

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/zencoder/go-remote-config
2+
3+
go 1.13
4+
5+
require github.com/stretchr/testify v0.0.0-20151102014159-c478a808a1b3

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/stretchr/testify v0.0.0-20151102014159-c478a808a1b3 h1:jU+Ex9dS6B1VdPZssLnmiZDt/VzsutuuvLNKq8Wl9U0=
2+
github.com/stretchr/testify v0.0.0-20151102014159-c478a808a1b3/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=

0 commit comments

Comments
 (0)