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

Build vignettes and Include tests in Binary packages #40

Merged
merged 11 commits into from
Aug 19, 2024
3 changes: 2 additions & 1 deletion .github/workflows/R-CMD-check-build.yaml
Copy link
Member

@Yuri05 Yuri05 Aug 19, 2024

Choose a reason for hiding this comment

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

should we change the step

     - uses: r-lib/actions/check-r-package@v2
        with:
          upload-snapshots: true
          build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
          error-on: 'c("error")'

to

     - uses: r-lib/actions/check-r-package@v2
        with:
          upload-snapshots: true
          args: 'c("--no-manual", "--as-cran", "--no-vignettes")'
          build_args: 'c("--no-manual", "--no-build-vignettes")'
          error-on: 'c("error")'

?

Because now vignettes are first built/checked in this step and then are rebuilt again in the next step.

Copy link
Member

Choose a reason for hiding this comment

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

s. also #34

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's better to make the process fail faster in case something is wrong in the vignette.

Copy link
Member

Choose a reason for hiding this comment

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

The question for me is what's the more often use case: vignettes contain errors, or vignettes contain no errors?

I think "vignettes contain no errors" would be mostly the case, because the vignettes are modified not as often as the code and ideally a developer should test a modified vignette locally before committing. And then having vignettes built/checked only once would save more time overall.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I agree and changed the workflow accordingly.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
run: |
output_dir <- file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "built_package")
dir.create(output_dir)
devtools::build(binary = TRUE, path = output_dir)
# first run build() to get a bundle package (that includes rendered vignettes), then create binary.
devtools::build(devtools::build(), binary = TRUE, path = output_dir, , args=c("--preclean", "--install-tests"))
Felixmil marked this conversation as resolved.
Show resolved Hide resolved
Felixmil marked this conversation as resolved.
Show resolved Hide resolved
shell: Rscript {0}

- name: Get package name, version and R versions and store in environment
Expand Down