GH Actions: remove cron job or limit to own repo
jrfnl opened this issue · 3 comments
Hi @rdohms
I noticed that the unit test workflow has a cron schedule to run daily.
I'm not sure why this has been added, but there is a downside to it: workflows which run cron jobs will be automatically disabled after two months of inactivity in a repository.
As this repository is not that active, that means that the run-tests
workflow will generally be disabled and would need to be re-enabled whenever any work gets done in this repo or when a PR is submitted to this repo (which will then have to be force pushed again to trigger the build).
It also means that - presuming the last merge build passed - this cron job will only ever fail when:
- One of the actions runner has changed and broken something;
- When there is a new PHPUnit release which would break something, but considering this repo is not using the PHPUnit native functionality, this is unlikely;
- Or when the PHP 8.1 run would fail, but as that one is marked as experimental, it wouldn't fail the build, so you still wouldn't get notified of it.
Also note that cron jobs also run on forks.
Having said all this, there are a couple of directions to go in:
- Either remove the cron schedule completely.
This would prevent the workflow from being automatically disabled and preserve resources (x16 - this repo + currently 15 forks). - Split the workflow into two duplicate scripts, one for PR CI and one with the cron job.
If the cron job then gets disabled, at least it would not block PRs from having CI run and getting merged. - Add a condition to the script to only run the cron job event for the main repo and not run it on forks.
I'd be happy to send in a PR to fix this, but would like to understand your reason for adding the cron job and know which solution would be preferred before I do so.
Good catch, I had noticed that weirdness as well.
This was a suggestion from when the GHA was contributed, but indeed after a while it started breaking down due to inactivity.
Let's go ahead and remove them. If you have your hands dirty I would love a PR otherwise I'll try to do it after Chloe is out tonight.