Run the second Job after the first one is complete

Hello @gmemstr! Thank you for your answer :slightly_smiling_face: I’ve looked through this documentation before, but I’m not sure if this is what I need. I can build a serial/parallel build if all I need is described in a single config.yml. The problem is that the build and deploy config is in one repository, but config.yml for tests is in another repository (+ versioning by branches). Or I don’t understand something.

Now my test config looks like this:

version: 2
jobs:
  build:
    docker:
      - image: circleci/ruby:2.4.1
    steps:
      - checkout
  build2:        ### This Job is described in another branch and it should not be here
    docker:
      - image: circleci/ruby:2.4.1
    steps:
      - checkout
      
workflows:
  version: 2
  first-job:
    jobs:
      - build:
          filters:
            branches:
              only: test-first    
  second-job:
    jobs:
      - build2:
          filters:
            branches:
              only: test-second    ## If branch is "test-first" - this work like parallel workflows, but I need to use the second branch 

I need to remove the “build2” from the config, since it is in a different branch/repository, and initiate the launch of the second configuration for tests after the “build” is complete"

This is my second config file for testing (conditionally), it is in the “test-second” branch:

version: 2
jobs:
  build2:
    docker:
      - image: circleci/ruby:2.4.1
    steps:
      - checkout

workflows:
  version: 2
  second-job:
    jobs:
      - build2:
          filters:
            branches:
              only: test-second