RMI-PACTA / actions

Actions for GitHub workflows
4 stars 0 forks source link

feat: #22 Add workflow for comparing versions of R repos #67

Closed AlexAxthelm closed 7 months ago

AlexAxthelm commented 7 months ago

Closes #22

Add an action to compare versions listed in DESCRIPTION, and fail if the version number in the branch is not greater than the version in the base (usually main)

Note that this only runs for pull_request events.

AlexAxthelm commented 7 months ago

See it in action:

Failing: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/8252790064/job/22573152645#step:6:50 Passing: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/8252821915/job/22573253913?pr=4#step:6:48

cjyetman commented 7 months ago

Does this mean that every merge to main must include a version bump?

AlexAxthelm commented 7 months ago

Does this mean that every merge to main must include a version bump?

Yeah. But dev version bumps satisfy this requirement. Also this can be disabled with the do-compare-versions input

AlexAxthelm commented 7 months ago

If we want, I could add in some checks that would only trigger if files in the R/ directory are changed

jdhoffa commented 7 months ago

Maybe worth chatting/ aligning with the rest of the tech team on this one, but I'm broadly in favor of all of it!

Also in favor of limiting it to the R/ folder, although I can imagine cases where inst/ for example may be important to consider too (like pacta.portfolio.report)

AlexAxthelm commented 7 months ago

Added a check for R-package relevant files before doing the semver check.

We might want to consider also not running some of the other R checks if the R files haven't been touched (like R CMD CHECK)

Demo: No R files touched: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/8263382165 R files touched no version bump: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/8263544514 R files & version bump: https://github.com/RMI-PACTA/pacta.workflow.utils/actions/runs/8263576094