2018-02-11 16:22:30 +00:00
|
|
|
version: 2
|
2019-01-09 00:34:09 +00:00
|
|
|
|
|
|
|
references:
|
|
|
|
workspace: &workspace
|
|
|
|
/go/src/github.com/spf13/cobra
|
|
|
|
|
|
|
|
run_tests: &run_tests
|
|
|
|
run:
|
|
|
|
name: "All Commands"
|
|
|
|
command: |
|
|
|
|
mkdir -p bin
|
|
|
|
curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.6/shellcheck
|
|
|
|
chmod +x bin/shellcheck
|
|
|
|
go get -t -v ./...
|
|
|
|
PATH=$PATH:$PWD/bin go test -v ./...
|
|
|
|
go build
|
|
|
|
if [ -z $NOVET ]; then
|
2019-03-20 21:21:26 +00:00
|
|
|
diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
|
2019-01-09 00:34:09 +00:00
|
|
|
fi
|
|
|
|
|
2018-02-11 16:22:30 +00:00
|
|
|
jobs:
|
|
|
|
go-current:
|
|
|
|
docker:
|
2019-03-20 21:21:26 +00:00
|
|
|
- image: circleci/golang:1.12
|
2019-01-09 00:34:09 +00:00
|
|
|
working_directory: *workspace
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *run_tests
|
|
|
|
- run:
|
|
|
|
name: "Check formatting"
|
|
|
|
command: diff -u <(echo -n) <(gofmt -d -s .)
|
2018-02-11 16:22:30 +00:00
|
|
|
go-previous:
|
|
|
|
docker:
|
2019-03-20 21:21:26 +00:00
|
|
|
- image: circleci/golang:1.11
|
2019-01-09 00:34:09 +00:00
|
|
|
working_directory: *workspace
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *run_tests
|
2018-02-11 16:22:30 +00:00
|
|
|
go-latest:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:latest
|
2019-01-09 00:34:09 +00:00
|
|
|
working_directory: *workspace
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- *run_tests
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
main:
|
|
|
|
jobs:
|
|
|
|
- go-current
|
|
|
|
- go-previous
|
|
|
|
- go-latest
|