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

CRAN emulator workflow #35

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

CRAN emulator workflow #35

wants to merge 12 commits into from

Conversation

cicdguy
Copy link
Collaborator

@cicdguy cicdguy commented Nov 7, 2022

Adds a workflow that allows you to test your R package on alternate Linux-based CRAN systems.

@cicdguy cicdguy self-assigned this Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Code Coverage

Package Line Rate Health
admiralci 0%
Summary 0% (0 / 3)

cicdguy and others added 5 commits January 7, 2023 06:21
* 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
@cicdguy cicdguy marked this pull request as ready for review February 12, 2023 14:20
@cicdguy cicdguy enabled auto-merge (squash) February 12, 2023 14:29
Copy link
Collaborator

@bms63 bms63 left a 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- main
- main
- pre-release

@cicdguy
Copy link
Collaborator Author

cicdguy commented Feb 12, 2023

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.

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")
Copy link

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().

Copy link
Collaborator Author

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()
Copy link

@pawelru pawelru Oct 19, 2023

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

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.

None yet

5 participants