Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,26 @@ jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: macos-latest, r: 'release', quarto: 'pre-release'}
- {os: macos-latest, r: 'release', quarto: false}

- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'release', quarto: 'pre-release'}
- {os: windows-latest, r: 'release', quarto: false}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release', quarto: 'pre-release'}
- {os: ubuntu-latest, r: 'release', quarto: false}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
Expand All @@ -49,16 +52,13 @@ jobs:
- uses: actions/checkout@v4

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


# replace with setting up QUARTO Pandoc for rmarkdown
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
Expand All @@ -70,8 +70,11 @@ jobs:
# install the package itself as we register vignette engine
extra-packages: any::rcmdcheck, local::.
needs: check
install-quarto: false
install-pandoc: false

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
args: ${{ format('c("--no-manual", "--as-cran"{0})', format('{0}', matrix.config.quarto) == 'false' && ',"--ignore-vignettes"' || '') }}
build_args: ${{ format('c("--no-manual","--compact-vignettes=gs+qpdf"{0})', format('{0}', matrix.config.quarto) == 'false' && ',"--no-build-vignettes"' || '') }}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: quarto
Title: R Interface to 'Quarto' Markdown Publishing System
Version: 1.5.0.9000
Version: 1.5.0.9001
Authors@R: c(
person("JJ", "Allaire", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0003-0174-9868")),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# quarto (development version)

- 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
not skipping when quarto was not available which failed on CRAN checks for MacOS and no binary were built. (thanks, @jabenninghoff, #282)

# quarto 1.5.0

## Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/helpers.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Use to test quarto availability or version lower than
skip_if_no_quarto <- function(ver = NULL) {
skip_if(is.null(quarto_path()), message = "Quarto is not available")
skip_if(
!quarto_available(min = ver, error = FALSE),
skip_if_not(
quarto_available(min = ver, error = FALSE),
message = sprintf(
"Version of quarto is lower than %s: %s.",
ver,
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-utils-extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test_that("qmd_to_r_script() writes R file that renders", {
})

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

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

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

qmd_to_r_script(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ test_that("write_yaml allows clean data", {
})

test_that("quarto_render uses write_yaml validation", {
skip_if_no_quarto()
skip_on_cran() # Skip on CRAN as we current throw warning only on CRAN
expect_snapshot(
error = TRUE,
Expand Down
Loading