I am trying to setup my circle-ci build workflow and the problem is only the first job in the workflow is getting executed but the build shows up as successful.
Stack: golang/1.9 and mongo/3
This is how my config.yml looks like:
version: 2.0
jobs:
test:
docker:
- image: circleci/golang:1.9
- image: circleci/mongo:3
working_directory: /go/src/github.com/{org_name}/{proj_name}
steps:
- checkout
- run: go get -u github.com/golang/dep/cmd/dep
- run: cd app && dep ensure
- run: go test -v ./...
build:
docker:
- image: circleci/golang:1.9
- image: circleci/mongo:3
working_directory: /go/src/github.com/{org_name}/{proj_name}
steps:
- checkout
- run: go get -u github.com/golang/dep/cmd/dep
- run: cd app && dep ensure
- run: cd app && go build
workflows:
version: 2
test_and_build:
jobs:
- test
- build:
requires:
- test
So the requirement here is that first the test job needs to execute which will run test cases and if its successful the second job will create a binary of the project, but it doesn’t execute the build job and shows the build as successful! Has anybody else faced this problem, What am i doing wrong? I have tried changing the order of the jobs but to no avail. Any help is appreciated. Am i missing something?