Skip to content

Commit

Permalink
Automatically skip when pandoc not installed (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored Dec 3, 2021
1 parent 3e17275 commit 25ce5b0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/no-pandoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: no-pandoc

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@v1
with:
build_args: "'--no-manual'"

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

6 changes: 5 additions & 1 deletion R/markdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ convert_markdown_to_html <- function(in_path, out_path, ...) {
} else if (rmarkdown::pandoc_available("1.12.3")) {
from <- "markdown_github-hard_line_breaks+tex_math_dollars+tex_math_single_backslash+header_attributes"
} else {
stop("Pandoc not available", call. = FALSE)
if (is_testing()) {
testthat::skip("Pandoc not available")
} else {
abort("Pandoc not available")
}
}

rmarkdown::pandoc_convert(
Expand Down

0 comments on commit 25ce5b0

Please sign in to comment.