DEV: Cancel in-progress test runs on PRs (PR #15096)


  1. in current state, this runs only tests OR linting OR ember stuff, as they all share the same key
  2. it would also probably cancel previous runs on main branch, and I think we’d like to run all tests to completion there

Thanks @CvX, I think I found a way to namespace the groups properly and avoid this cancelling main branch commit runs.

And it looks like it’s working, the one thing I don’t like about it is that it slaps an :x: to commits with cancelled runs.

Well, two things, it’s also annoying that it sends you notifications for the cancelled runs.

Yeah, nothing we can do about that!

Could you confirm on your fork that it indeed doesn’t cancel running workflows on main? I’m not sure format('{0}-{1}', github.head_ref, github.job) is ever falsy, which would mean the second part after || doesn’t get a chance to be executed.

It looks like PRs are indeed not canceling main branch workflows with this change. Tested in Dev cancel in progress ci test runs by pmusaraj · Pull Request #15 · pmusaraj/discourse · GitHub.

But do two consecutive commits to main run all the way to completion?

Yes, looks like consecutive commits to main do not cancel each other’s CI runs.