Fixes CircleCI

This commit is contained in:
Ryan Curtin 2021-12-16 14:13:53 -05:00
parent 2a36c3f409
commit c21dc0fc86

View file

@ -1,53 +1,30 @@
version: 2 version: 2
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
diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
fi
jobs: jobs:
go-current: build:
docker: docker:
- image: circleci/golang:1.11 # specify the version
working_directory: *workspace - image: circleci/golang:1.15
steps: auth:
- checkout username: $DOCKERHUB_USER
- *run_tests password: $DOCKERHUB_PASSWORD
- run: environment: # environment variables for primary container
name: "Check formatting" DEPLOYMENT: test
command: diff -u <(echo -n) <(gofmt -d -s .)
go-previous:
docker:
- image: circleci/golang:1.10
working_directory: *workspace
steps:
- checkout
- *run_tests
go-latest:
docker:
- image: circleci/golang:latest
working_directory: *workspace
steps:
- checkout
- *run_tests
#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /go/src/github.com/OneCloudInc/cobra
steps:
- checkout
- run:
name: Run tests
command: |
go test ./...
workflows: workflows:
version: 2 version: 2
main: workflow:
jobs: jobs:
- go-current - build:
- go-previous context:
- go-latest - dockerhub