Continue running other jobs after required job fails

Building upon the discussion here, I’d like a way for a job to run even though a previous job in the workflow has failed in some way.

I know about when for a step, but there doesn’t seem to be something like this for a workflow’s job.

We’re currently having to do something like test_lib || true to make the CI step pass even though it’s actually a failure. That’s definitely a code smell to us.

Example use case:

# this is a `job` in CircleCI's vernacular
- report_build_statuses:
    requires:
      - install_gem_dependencies
      - lint_with_danger
      - build_app
      - test_lib
    filters: *ignore_certain_pr_builds

Expected Behavior

In this scenario, I’d like the report_build_statuses job to run even though the test_lib job failed some tests (and it depends on that job running, either successfully or not, before it can run).

So this would:

  1. Report back to Github that test_lib failed its tests
  2. Run report_build_statuses which would summarize those failings in a GitHub comment (we do this using Danger) and avoids us having to dig through CircleCI logs to figure out what failed

Existing Behavior

Currently, it just fails the test_lib job and then never runs report_build_statuses because apparently the requires keyword has the requirement that each job succeeds rather than just requiring that each job runs.

1 Like

Hi @iwasrobbed, This isn’t currently posible, but it is something that others have been interested in as well. Could you add your vote and use case to this Idea post? Thanks!

4 Likes

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