nextstrain / .github

8 stars 11 forks source link

pathogen-repo-ci: Don't run workflow build steps if they're not going to do anything #96

Closed tsibley closed 3 months ago

tsibley commented 3 months ago

Instead of checking for whether to do anything or not inside each build step individually, move the check to the step's condition. This will make the logs a lot clearer and mean the GitHub workflow metadata stays more in sync with reality.

I've used hashFiles() to check for file existence—it returns the empty string, a falsey value, when there are no matching files—but we could swap that out for using the output of a prior setup step that runs some shell to determine what to run and what to skip. Doing so might make more sense if the conditional becomes more complicated or we want to do more detailed reporting on why steps were skipped or not.

With the changes, the internal-to-this-workflow action, run-nextstrain-ci-build, is no longer that useful and so I've removed it in favor of inlining things. I think this is an improvement for readability.

Related-to: https://github.com/nextstrain/.github/pull/95#pullrequestreview-2113680284

Checklist

genehack commented 3 months ago

I don't understand why it needs to be generated from a template? What's going on with that?

tsibley commented 3 months ago

Rebased to account for later updates made in #95 and resolve conflicts.