mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
Fixes CircleCI
This commit is contained in:
parent
2a36c3f409
commit
c21dc0fc86
1 changed files with 23 additions and 46 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue