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

Expanding the CI workflows #11

Merged
merged 17 commits into from
Nov 30, 2023
Merged

Conversation

Moohan
Copy link
Member

@Moohan Moohan commented Aug 24, 2022

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.

Moohan and others added 8 commits August 24, 2022 15:42
I've renamed and re-written the R-CMD-check workflow to be more consistent.

It is now based on the r-lib v2 action examples and runs against a collection of R versions to represent the PHS current and future potential setup
This workflow will check and report test coverage to codecov.io
This will build the package documentation, Readme and vignettes into a website on a new branch `gh_pages` this can be deployed to GitHub pages with the right permissions.
This will run whenever a relevant filetype is modified and style the package with `styler` to the tidyverse style.

All the changes will be only cosmetic but will ensure consistency.
Will run when any files in the `R` directory are modified and ensure the package documentation is up to date.
It will run on any push or pull and add annotiations to the commit / PR with suggestions from `lintr` which provides best practice.
@Moohan Moohan requested a review from daikman August 24, 2022 15:18
@Moohan Moohan self-assigned this Aug 24, 2022
I realised that I did actually have permissions
@daikman
Copy link
Contributor

daikman commented Aug 25, 2022

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

@Moohan
Copy link
Member Author

Moohan commented Aug 25, 2022

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
Copy link
Member Author

Moohan commented Sep 6, 2022

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 r-lib/actions#616 r-lib/actions#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
Copy link
Member Author

Moohan commented May 2, 2023

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.

@Moohan Moohan merged commit 422ebe8 into Public-Health-Scotland:master Nov 30, 2023
14 checks passed
@Moohan Moohan deleted the expand_ci branch November 30, 2023 12:49
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.

2 participants