Skip to content

Commit a502203

Browse files
author
LiNk-NY
committed
add R CMD check action
1 parent fbed32e commit a502203

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/basic_checks.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: R CMD check
2+
3+
on:
4+
push:
5+
branches:
6+
- devel
7+
paths:
8+
- 'DESCRIPTION'
9+
- '**basic_checks.yml'
10+
workflow_dispatch:
11+
pull_request:
12+
branches:
13+
- devel
14+
15+
env:
16+
cache-version: v1
17+
18+
jobs:
19+
r-build-and-check:
20+
runs-on: ubuntu-latest
21+
container: bioconductor/bioconductor_docker:devel
22+
23+
env:
24+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: TRUE
25+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
26+
CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest
27+
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v4
31+
32+
- name: Query dependencies and update old packages
33+
run: |
34+
BiocManager::install(ask=FALSE)
35+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
36+
shell: Rscript {0}
37+
38+
- name: Cache R packages
39+
if: runner.os != 'Windows'
40+
uses: actions/cache@v4
41+
with:
42+
path: /usr/local/lib/R/site-library
43+
key: ${{ env.cache-version }}-${{ runner.os }}-r-${{ hashFiles('.github/depends.Rds') }}
44+
restore-keys: ${{ env.cache-version }}-${{ runner.os }}-r-
45+
46+
- name: Install dependencies
47+
run: |
48+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories())
49+
remotes::install_cran(c("rcmdcheck", "covr"))
50+
shell: Rscript {0}
51+
52+
- name: Run rcmdcheck
53+
env:
54+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
55+
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
56+
shell: Rscript {0}
57+
58+
- name: Run BiocCheck
59+
env:
60+
DISPLAY: ':99.0'
61+
run: |
62+
BiocCheck::BiocCheck(
63+
dir('check', 'tar\\.gz$', full.names = TRUE),
64+
`quit-with-status` = FALSE,
65+
`no-check-R-ver` = TRUE,
66+
`no-check-bioc-help` = TRUE
67+
)
68+
shell: Rscript {0}

0 commit comments

Comments
 (0)