Should 'requires' property keep artefacts from previous steps?

nodejs
docker
config
cci-20

#1

I am following the example CircleCi 2.0 sample below:

https://circleci.com/docs/2.0/sample-config/

The issue is that artefacts from the previous steps aren’t available to the next step, so this seems to make the sample config invalid? The only way I can make this work is by duplicating the checkout, install and build steps, otherwise the test fails, since neither checked out repo or node_modules are retained from the the build job.

The workflow section is as follows:

workflows:
  version: 2
  build_and_test:
    jobs:
      - build
      - test:
          requires:
            - build
          filters:
            branches:
              only: master

Can anyone tell me whether this is likely to be an issue in something I am doing or whether the sample-config is outdated?


#2