Skip to content

Commit 8c2dc06

Browse files
authored
Be sure to build and check when no quarto is available (#287)
This is necessary to have no CRAN failure in all environment, as it seems that Quarto is not available everywhere on CRAN machines
1 parent 687ccbc commit 8c2dc06

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@ jobs:
1919
R-CMD-check:
2020
runs-on: ${{ matrix.config.os }}
2121

22-
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) [Quarto ${{ matrix.config.quarto || 'release' }}]
22+
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) [${{ format('{0}', matrix.config.quarto) == 'false' && 'No ' || ''}}Quarto ${{ matrix.config.quarto || 'release' }}]
2323

2424
strategy:
2525
fail-fast: false
2626
matrix:
2727
config:
2828
- {os: macos-latest, r: 'release'}
2929
- {os: macos-latest, r: 'release', quarto: 'pre-release'}
30+
- {os: macos-latest, r: 'release', quarto: false}
3031

3132
- {os: windows-latest, r: 'release'}
3233
- {os: windows-latest, r: 'release', quarto: 'pre-release'}
34+
- {os: windows-latest, r: 'release', quarto: false}
3335
# use 4.1 to check with rtools40's older compiler
3436
- {os: windows-latest, r: '4.1'}
3537

3638
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
3739
- {os: ubuntu-latest, r: 'release'}
3840
- {os: ubuntu-latest, r: 'release', quarto: 'pre-release'}
41+
- {os: ubuntu-latest, r: 'release', quarto: false}
3942
- {os: ubuntu-latest, r: 'oldrel-1'}
4043
- {os: ubuntu-latest, r: 'oldrel-2'}
4144
- {os: ubuntu-latest, r: 'oldrel-3'}
@@ -49,16 +52,13 @@ jobs:
4952
- uses: actions/checkout@v4
5053

5154
- uses: quarto-dev/quarto-actions/setup@v2
55+
if: format('{0}', matrix.config.quarto) != 'false'
5256
env:
5357
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5458
with:
5559
version: ${{ matrix.config.quarto || 'release' }}
5660
tinytex: true
5761

58-
59-
# replace with setting up QUARTO Pandoc for rmarkdown
60-
- uses: r-lib/actions/setup-pandoc@v2
61-
6262
- uses: r-lib/actions/setup-r@v2
6363
with:
6464
r-version: ${{ matrix.config.r }}
@@ -70,8 +70,11 @@ jobs:
7070
# install the package itself as we register vignette engine
7171
extra-packages: any::rcmdcheck, local::.
7272
needs: check
73+
install-quarto: false
74+
install-pandoc: false
7375

7476
- uses: r-lib/actions/check-r-package@v2
7577
with:
7678
upload-snapshots: true
77-
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
79+
args: ${{ format('c("--no-manual", "--as-cran"{0})', format('{0}', matrix.config.quarto) == 'false' && ',"--ignore-vignettes"' || '') }}
80+
build_args: ${{ format('c("--no-manual","--compact-vignettes=gs+qpdf"{0})', format('{0}', matrix.config.quarto) == 'false' && ',"--no-build-vignettes"' || '') }}

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: quarto
22
Title: R Interface to 'Quarto' Markdown Publishing System
3-
Version: 1.5.0.9000
3+
Version: 1.5.0.9001
44
Authors@R: c(
55
person("JJ", "Allaire", , "[email protected]", role = "aut",
66
comment = c(ORCID = "0000-0003-0174-9868")),

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# quarto (development version)
22

3+
- Make sure tests pass on CRAN checks even when Quarto is not installed by adding a gihub action to test when no quarto is available. Also fix tests that were
4+
not skipping when quarto was not available which failed on CRAN checks for MacOS and no binary were built. (thanks, @jabenninghoff, #282)
5+
36
# quarto 1.5.0
47

58
## Breaking changes

tests/testthat/helpers.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Use to test quarto availability or version lower than
22
skip_if_no_quarto <- function(ver = NULL) {
33
skip_if(is.null(quarto_path()), message = "Quarto is not available")
4-
skip_if(
5-
!quarto_available(min = ver, error = FALSE),
4+
skip_if_not(
5+
quarto_available(min = ver, error = FALSE),
66
message = sprintf(
77
"Version of quarto is lower than %s: %s.",
88
ver,

tests/testthat/test-utils-extract.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test_that("qmd_to_r_script() writes R file that renders", {
4747
})
4848

4949
test_that("qmd_to_r_script() comment cells with eval = TRUE", {
50+
skip_if_no_quarto()
5051
r_script <- withr::local_tempfile(pattern = "purl", fileext = ".R")
5152

5253
qmd_to_r_script(
@@ -67,6 +68,7 @@ test_that("qmd_to_r_script() comment cells with eval = TRUE", {
6768
})
6869

6970
test_that("qmd_to_r_script() ignore cells with purl = FALSE", {
71+
skip_if_no_quarto()
7072
r_script <- withr::local_tempfile(pattern = "purl", fileext = ".R")
7173

7274
qmd_to_r_script(

tests/testthat/test-utils.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ test_that("write_yaml allows clean data", {
112112
})
113113

114114
test_that("quarto_render uses write_yaml validation", {
115+
skip_if_no_quarto()
115116
skip_on_cran() # Skip on CRAN as we current throw warning only on CRAN
116117
expect_snapshot(
117118
error = TRUE,

0 commit comments

Comments
 (0)