Public-Health-Scotland / phsopendata

Functions to extract and interact with data from the Scottish Health and Social Care Open Data platform.
https://public-health-scotland.github.io/phsopendata/
9 stars 3 forks source link

Expanding the CI workflows #11

Closed Moohan closed 11 months ago

Moohan commented 2 years ago

I'm updating the CI on all the PHS packages.

I've updated the R-CMD check to use the standard actions from r-lib, rather than the custom code it had. I've also expanded the number of R versions it runs against with an argument to specify whether they are must_pass or not i.e. will the whole workflow fail if they do? The versions of R selected are from a brief chat with Russell and are trying to balance what is available now with what we will have on the new R infrastructure, as well as what any external users might be using...

I added a pkgdown workflow which will build the package documentation, readme and vignettes to a new gh_pages branch. This can be deployed directly to Github pages but I don't have permission to do that.

I've also added workflows to automatically document, style and lint any code. The idea is that these will run on any PR code and resolve any simple issues automatically.

daikman commented 2 years ago

These seem like great ideas to me. Any idea why the document and style checks are failing on the most recent commit?

Moohan commented 2 years ago

These seem like great ideas to me. Any idea why the document and style checks are failing on the most recent commit?

I think because I made a change as it was still running so the branch it had checked out became detached. If you look at the job notes they failed because of something to do with git...

I've had those errors before and they don't seem to be fatal, I assume they're not in this case either.

Moohan commented 2 years ago

These seem like great ideas to me. Any idea why the document and style checks are failing on the most recent commit?

I think because I made a change as it was still running so the branch it had checked out became detached. If you look at the job notes they failed because of something to do with git...

I've had those errors before and they don't seem to be fatal, I assume they're not in this case either.

I think this issue is actually because roxygen::document() edits the DESCRIPTION file (by changing the RoxygenNote: to a newer version) but because that is the only file changed, and because it's not set to commit changes to DESCRIPTION it fails.

Similarly, for the style workflow, I think it's because the tests/ are the only files being styled but are not set to be committed.

I've opened bug reports on https://github.com/r-lib/actions/issues/616 https://github.com/r-lib/actions/issues/617 so we can see what they say. Possibly I'm totally wrong in my assessment of the issue!

I realised that on another repo I've just replaced the default commit code with another action: style.yaml on source-linkage-files

Moohan commented 1 year ago

I've just updated this PR with the latest examples from r-lib[]). I'd opened issues with them about the errors we were seeing and they have recently resolved these. It now looks like the workflows all succeed as expected.