Skip to content

Commit

Permalink
Merge branch 'feature-refactor'
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrlsnchs committed Jul 12, 2019
2 parents 6f6efa0 + 844855e commit c765d26
Show file tree
Hide file tree
Showing 39 changed files with 2,398 additions and 521 deletions.
60 changes: 60 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 2.1

executors:
golang:
parameters:
version:
description: Go version
type: string
docker:
- image: circleci/golang:<< parameters.version >>

commands:
test:
steps:
- run: make
- run: make test

workflows:
test:
jobs:
- go1_9
- go1_10
- go1_11
- go1_12

jobs:
go1_12: &template
executor:
name: golang
version: "1.12"
steps:
- checkout
- test

go1_11:
<<: *template
executor:
name: golang
version: "1.11"

go1_10: &nomod_template
<<: *template
environment:
GO111MODULE: off
GO_COMMAND: vgo
executor:
name: golang
version: "1.10"
working_directory: /go/src/github.com/gbrlsnchs/jwt
steps:
- checkout
- run: go get -u golang.org/x/crypto/ed25519
- run: go get -u golang.org/x/xerrors
- test

go1_9:
<<: *nomod_template
executor:
name: golang
version: "1.9"
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

39 changes: 14 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
install: export GO111MODULE := on
install:
current_dir := ${PWD}
@cd ${GOPATH}
go get github.com/golangci/golangci-lint/cmd/[email protected]
export GO111MODULE ?= on

all: export GO111MODULE := off
all:
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/lint/golint

lint: golint_cmd := golint -set_exit_status
lint:
@echo "+++ 'lint' (${golint_cmd})"
@${golint_cmd}
fix:
@goimports -w *.go

test-units: export GO111MODULE := on
test-units: go_test_flags := -v -coverprofile=c.out
ifdef GO_TEST_RUN
test-units: go_test_flags += -run=${GO_TEST_RUN}
endif
test-units: GO_TEST_TARGET ?= ./...
test-units: go_test_cmd := go test ${go_test_flags} ${GO_TEST_TARGET}
test-units:
@echo "+++ 'test-units' (${go_test_cmd})"
@${go_test_cmd}
lint:
@! goimports -d . | grep -vF "no errors"
@golint -set_exit_status ./...

test-cover: export GO111MODULE := on
test-cover: go_tool_cover := go tool cover -func=c.out
test-cover:
@echo "+++ 'test-cover' (${go_tool_cover})"
@${go_tool_cover}
bench:
@go test -v -run=^$$ -bench=.

test: test-units lint
test: lint
@go test -v ./...
Loading

0 comments on commit c765d26

Please sign in to comment.