Only the first job runs in a workflow, circleci/2.0

golang

#1

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?


#2

@sjnonweb - have you ever resolved this issue? I have a similar setup and only the first job in my workflow is running. Thanks!


#3

@meg Yes, it turns out the second job was running after all. It just shows up in a separate job than the first one.


#4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.