Continue Workflow After Failure

Hi, I am just wondering if it is possible to continue the workflow even after certain jobs have failed. Currently, I have configured my workflow to run in multiple stages of parallel tests. (IE first the build, then credo and linter tests in parallel, and then the test suite tests in parallel). I am just wondering if it is possible to continue the workflow even after some of the earlier jobs have failed? For example, when the credo and linter check shows there are changes to be made (which CircleCI marks as failure), I want the workflow to continue to the test suite and not to halt.

Thanks in advance

3 Likes

Yes @sammallabone, that is possible.

If you have jobs that should not halt the workflow, just remove that job name from any requires directive. Alternately you could require in a job further downstream if you want to let intermediate jobs run before deciding to fail or not.

I one of my projects, I run static code analysis, but don’t block deployments if it fails.

workflows:
  version: 2
  build-deploy:
    jobs:
      - unit-test
      - test-chrome:
          requires:
            - unit-test
      - test-ie:
          requires:
            - unit-test
      - SCA:
          requires:
            - unit-test
      - package:
          requires:
            - unit-test
          filters:
            branches:
              only: master
      - dark-deploy:
          requires:
            - package
          filters:
            branches:
              only: master
      - hold:
          type: approval
          requires:
            - dark-deploy
            - test-ie
            - test-chrome
          filters:
            branches:
              only: master
      - live-deploy:
          requires:
            - hold
          filters:
            branches:
              only: master

Thanks for replying @eddiewebb, I understand that but what if your unit-test’s failed and you still wanted to complete the following jobs? Is it possible to move past the failing unit-test job without changing the way your workflow was configured? This way you could run all your tests to see just how much is failing

2 Likes

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