Config does not conform to schema When trying to use workflows

Hello, I’m to circleCI and trying to get my jest tests to run.

I’d really like to use a workflow to combine my build job (compile a parser) and my test job (run the jest tests). When I put everything in one job like this it works:

version: 2.0
jobs:
  build:
    docker:
      - image: circleci/node:10.16.0

    steps:
      - checkout
      - run: npm install
      - run: npm run compile-grammar
      - run: npm test

But when I try to use an actual workflow like this

version: 2.0
jobs:
  build:
    docker:
      - image: circleci/node:10.16.0

    steps:
      - checkout
      - run: npm install
      - run: npm run compile-grammar

  test:
    docker:
      - image: circleci/node:10.16.0

    steps:
      - run: npm test

# Now that I have workflows, the default job of "build" shouldn't auto-trigger
workflows:
  version: 2
  build-test:
    jobs:
      - build
      - test:
        requires:
          - build

I get the error Config does not conform to schema: {:workflows {:build-test {:jobs [nil {:test (not (map? nil)), :requires (not (map? a-clojure.lang.LazySeq))}]}}}

Try nesting requires one level deeper. But also keep in mind, separately: each job runs in a wholly independent container, so what you do in your build job won’t be there when your test job starts unless you do something like save it to a workspace and then restore that in test

1 Like

Oh wow! I didn’t realize that the whitespace mattered. Thank you @ndintenfass

You’re right that the tests don’t run properly because the build stuff doesn’t hang around, but I think I can take it from here.

Thanks again.

1 Like