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
CRAN emulator workflow #35
base: main
Are you sure you want to change the base?
Conversation
* Add lintr to run on changed files only. * On pull request lint only files that was changed. * Add github api url fmt to ignored * Update lintr.yml * Use get-changed-files action * Escape json correctly * Cleanup .lycheeignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is a final action for when we do a merge in main that mimics some of the CRAN checks? Could we also set it for pre-release as that is what we send to CRAN usually.
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- main | |
- main | |
- pre-release |
Yes, we can do that. I'll add a sample workflow and documentation for this here. |
uses: actions/checkout@v3 | ||
|
||
- name: Install devtools | ||
run: install.packages("devtools", repos = "https://cloud.r-project.org") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that devtools
is a big package with a lot of dependencies. There is a much "ligter" alternative pak::local_install_dev_deps()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I'll change it up
shell: Rscript {0} | ||
|
||
- name: Install package dependencies | ||
run: devtools::install_dev_deps() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this might have undesired side effect on the R CMD CHECK you are executing here. What if your utils package (regardless if it's devtools
or pak
) will install also package X and this package will be required but not specified in your tested package. You will have a false positive.
There are two ways to address that problem
A) utils package to temp libpath
- create temp libpath and install utils package there
- use it from temp libpath and install dev deps to default libpath
- RCMDCHECK from default libpath
B) dev deps to temp libpath
- install utils package inside default libpath
- use it from default libpath and install dev deps to temp libpath
- RCMDCHECK from temp libpath
(I personally used B) in verdepcheck and when executing R CMD CHECK viarcmdcheck
package and stopped onlibpath
argument is not respected during build step r-lib/rcmdcheck#195. Haven't tried this from shell)
Adds a workflow that allows you to test your R package on alternate Linux-based CRAN systems.