Skip to content

Commit 687d5ed

Browse files
Workflow(check): adding R CMD check workflow
1 parent bb2420a commit 687d5ed

4 files changed

Lines changed: 40 additions & 9 deletions

File tree

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: R-CMD-check
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
R-CMD-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: r-lib/actions/setup-r@v2
16+
with:
17+
use-public-rspm: true
18+
19+
- name: Install dependencies
20+
run: |
21+
Rscript -e 'install.packages("remotes")'
22+
Rscript -e 'remotes::install_deps(dependencies = TRUE)'
23+
24+
- name: Install renv
25+
run: Rscript -e 'install.packages("renv")'
26+
27+
- name: Restore project environment from renv.lock
28+
run: Rscript -e 'renv::restore()'
29+
30+
- name: Build package
31+
run: R CMD build .
32+
33+
- name: Check package
34+
run: R CMD check --no-manual --as-cran *.tar.gz

.github/workflows/pkgdown.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# 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
32
on:
43
push:
54
branches: [main, master]
@@ -15,7 +14,6 @@ permissions: read-all
1514
jobs:
1615
pkgdown:
1716
runs-on: ubuntu-latest
18-
# Only restrict concurrency for non-PR jobs
1917
concurrency:
2018
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2119
env:
@@ -31,10 +29,11 @@ jobs:
3129
with:
3230
use-public-rspm: true
3331

34-
- uses: r-lib/actions/setup-r-dependencies@v2
35-
with:
36-
extra-packages: any::pkgdown, local::.
37-
needs: website
32+
- name: Install renv
33+
run: Rscript -e 'install.packages("renv")'
34+
35+
- name: Restore project environment from renv.lock
36+
run: Rscript -e 'renv::restore()'
3837

3938
- name: Build site
4039
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[![DOI](https://zenodo.org/badge/306332649.svg)](https://zenodo.org/badge/latestdoi/306332649)
22
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15733817.svg)](https://doi.org/10.5281/zenodo.15733817)
33

4+
![R-CMD-check](https://github.com/WonLab-CS/Vesalius/actions/workflows/R-CMD-check.yml/badge.svg?branch=main)
45

56
# Vesalius
67

vignettes/vesalius.Rmd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ will apply for other modalities. For examples using other modalities,
5555
please refer to the other articles.
5656

5757
```{r loading, eval = TRUE, echo = TRUE}
58-
suppressMessages(library(vesalius))
59-
library(renv)
60-
renv::restore(lockfile = "../renv.lock")
6158
libary(vesalius)
6259
data(vesalius, package = "vesalius")
6360

0 commit comments

Comments
 (0)