Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 13 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,26 @@
---
version: 2
executorType: docker
containerInfo:
- image: library/golang
environment:
AWS_ACCESS_KEY_ID: 1
AWS_SECRET_ACCESS_KEY: 1
GLIDE_VERSION: 0.12.3
jobs:
build:
workdir: "/go/src/github.com/zencoder/go-remote-config"
docker:
- image: circleci/golang
steps:
- checkout
- run:
name: Install Glide
command: |
set -eux
curl -sSLfO https://github.com/Masterminds/glide/releases/download/v${GLIDE_VERSION}/glide-v${GLIDE_VERSION}-linux-amd64.tar.gz
mkdir glide
tar -xzf glide-v${GLIDE_VERSION}-linux-amd64.tar.gz -C ./glide
cp ./glide/linux-amd64/glide /usr/local/bin/glide
rm -r glide glide-v${GLIDE_VERSION}-linux-amd64.tar.gz
- restore_cache:
key: glide-{{ checksum "glide.lock" }}
key: go-mod-{{ checksum "go.sum" }}
- run:
name: Download vendored Go dependencies
command: glide install
name: Download Go dependencies
command: go mod download
- save_cache:
key: glide-{{ checksum "glide.lock" }}
key: go-mod-{{ checksum "go.sum" }}
paths:
- vendor
- run:
name: Install required tooling
command: |
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get github.com/modocache/gover
- /go/pkg/mod
- run:
name: Run unit tests
command: |
make test
- run:
name: Collect coverage reports
command: |
make cover
- run:
name: Submit coverage to coveralls.io
command: |
make coveralls
make
experimental:
notify:
branches:
only:
- master
41 changes: 22 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
COVERAGEDIR = coverage
ifdef CIRCLE_ARTIFACTS
COVERAGEDIR = $(CIRCLE_ARTIFACTS)
endif
# Force-enable Go modules even if this project has been cloned within a user's GOPATH
export GO111MODULE = on

# Specify VERBOSE=1 to get verbose output from all executed commands
ifdef VERBOSE
V = -v
X = -x
else
.SILENT:
endif

install-deps:
glide install
.PHONY: all
all: build test

.PHONY: clean
clean:
rm -rf bin/ coverage/ cucumber/logs/
go clean -i $(X) -cache -testcache

.PHONY: build
build:
mkdir -p bin
go build $(V) -o bin/go-remote-config
go build $(V) -o bin/gokay

.PHONY: fmt
fmt:
go fmt ./...
go fmt $(X) ./...

test: export AWS_ACCESS_KEY_ID := 1
test: export AWS_SECRET_ACCESS_KEY := 1
.PHONY: test
test:
mkdir -p coverage
go test $(V) ./ -race -cover -coverprofile=$(COVERAGEDIR)/remoteconfig.coverprofile
go test $(V) -race -cover -coverprofile coverage/cover.profile ./...

.PHONY: cover
cover:
go tool cover -html=$(COVERAGEDIR)/remoteconfig.coverprofile -o $(COVERAGEDIR)/remoteconfig.html
coveralls:
gover $(COVERAGEDIR) $(COVERAGEDIR)/coveralls.coverprofile
goveralls -coverprofile=$(COVERAGEDIR)/coveralls.coverprofile -service=circle-ci -repotoken=$(COVERALLS_TOKEN)
clean:
go clean
rm -f bin/go-remote-config
rm -rf coverage/
go tool cover -html coverage/cover.profile
10 changes: 0 additions & 10 deletions glide.lock

This file was deleted.

8 changes: 0 additions & 8 deletions glide.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/zencoder/go-remote-config

go 1.13

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