Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: cancel runs if newer commit available and update checkout action #1416

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

rem1776
Copy link
Contributor

@rem1776 rem1776 commented Nov 20, 2023

Description
This adds the same setting Lauren added to the FV3 parallelworks CI. It'll cancel a run in progress if a newer commit is available.

This should help with storage usage and we should have quicker checks with PR's as well since it won't be wasting time on the older commits.

also updates all our checkout actions versions to the newest since the old one was deprecated.

How Has This Been Tested?
ci

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

Copy link
Member

@thomas-robinson thomas-robinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How tested is this? It's not going to cancel a workflow from a different PR, right?

@laurenchilutti
Copy link
Contributor

How tested is this? It's not going to cancel a workflow from a different PR, right?

My understanding is that it will cancel any in process action that matched the conceurrency group. So we name the concurrency group ${{ github.workflow }}-${{ github.ref }} which translates to <name-of-workflow>-<refs/pr/##> for a PR. So this will only cancel in process runs of the same workflow and PR.

I have not tested this on workflow triggered by"push" as in the dycore, we only trigger on PRs

@laurenchilutti
Copy link
Contributor

When I did this for the dycore, I tested it in my PR that brought in the workflow yaml changes (the equivalent of this PR for FMS). You can keep making dummy commits to test that it properly cancels the previous commits CI on this PR

@rem1776
Copy link
Contributor Author

rem1776 commented Nov 20, 2023

When I did this for the dycore, I tested it in my PR that brought in the workflow yaml changes (the equivalent of this PR for FMS). You can keep making dummy commits to test that it properly cancels the previous commits CI on this PR

Thanks @laurenchilutti , I'll try that now and check the how it works with the pushes on my fork.

@rem1776
Copy link
Contributor Author

rem1776 commented Nov 20, 2023

@laurenchilutti @thomas-robinson looks like its working as intended, will only cancel jobs on the same branch with pushes as well.

@rem1776 rem1776 merged commit 7898b51 into NOAA-GFDL:main Nov 21, 2023
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants