Skip to content

Commit f4e8798

Browse files
authored
add R CMD check without packages in Suggests (#82)
* add check without packages in Suggests * skip dependent tests when Suggests not available
1 parent 01764ff commit f4e8798

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends,
5+
# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never
6+
# installed, with the exception of testthat, knitr, and rmarkdown. The cache is
7+
# never used to avoid accidentally restoring a cache containing a suggested
8+
# dependency.
9+
on:
10+
push:
11+
branches: [main, master]
12+
pull_request:
13+
branches: [main, master]
14+
15+
name: R-CMD-check-no-suggests.yaml
16+
17+
permissions: read-all
18+
19+
jobs:
20+
check-no-suggests:
21+
runs-on: ${{ matrix.config.os }}
22+
23+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
config:
29+
- {os: ubuntu-latest, r: 'release'}
30+
31+
env:
32+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
33+
R_KEEP_PKG_SOURCE: yes
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- uses: r-lib/actions/setup-pandoc@v2
39+
40+
- uses: r-lib/actions/setup-r@v2
41+
with:
42+
r-version: ${{ matrix.config.r }}
43+
http-user-agent: ${{ matrix.config.http-user-agent }}
44+
use-public-rspm: true
45+
46+
- uses: r-lib/actions/setup-r-dependencies@v2
47+
with:
48+
dependencies: '"hard"'
49+
cache: false
50+
extra-packages: |
51+
any::rcmdcheck
52+
any::testthat
53+
any::knitr
54+
any::rmarkdown
55+
needs: check
56+
57+
- uses: r-lib/actions/check-r-package@v2
58+
with:
59+
upload-snapshots: true
60+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ knitr::opts_chunk$set(
1818
[![CRAN status](https://www.r-pkg.org/badges/version/shinymodels)](https://CRAN.R-project.org/package=shinymodels)
1919
[![Codecov test coverage](https://codecov.io/gh/tidymodels/shinymodels/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/shinymodels?branch=main)
2020
[![R-CMD-check](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml)
21+
[![R-CMD-check-no-suggests](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml)
2122
<!-- badges: end -->
2223

2324
The goal of shinymodels is to launch a Shiny app given tidymodels' tuning or resampling results, to make it easier to explore the modeling results.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ status](https://www.r-pkg.org/badges/version/shinymodels)](https://CRAN.R-projec
1010
[![Codecov test
1111
coverage](https://codecov.io/gh/tidymodels/shinymodels/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/shinymodels?branch=main)
1212
[![R-CMD-check](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml)
13+
[![R-CMD-check-no-suggests](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml)
1314
<!-- badges: end -->
1415

1516
The goal of shinymodels is to launch a Shiny app given tidymodels’

tests/testthat/test-first_level.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
skip_if_not_installed("modeldata")
2+
13
library(testthat)
24
library(shinymodels)
35

tests/testthat/test-first_level_prob_name.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
skip_if_not_installed("modeldata")
2+
13
library(testthat)
24
library(shinymodels)
35

0 commit comments

Comments
 (0)