Continue Workflow After Failure

circle.yml
#1

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

0 Likes

#2

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
0 Likes

#3

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

0 Likes

closed #4

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

0 Likes