Skip to content

Commit 5709720

Browse files
committed
implement GHA
1 parent a443b93 commit 5709720

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/check.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
on:
2+
push:
3+
pull_request:
4+
5+
name: R-CMD-check
6+
7+
jobs:
8+
check:
9+
runs-on: ${{ matrix.config.os }}
10+
env:
11+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
12+
_R_CHECK_TESTS_NLINES_: 0
13+
NOT_CRAN: true
14+
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: true
15+
_R_CHECK_FORCE_SUGGESTS_: false #TODO: drop this for now!
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {os: macos-latest, r: 'release'}
24+
- {os: windows-latest, r: 'release', rtools-version: '44'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-24.04, r: 'release'}
27+
28+
steps:
29+
30+
## Most of these steps are the same as the ones in
31+
## https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
32+
## If they update their steps, we will also need to update ours.
33+
- name: Checkout Repository
34+
uses: actions/checkout@v3
35+
36+
## pandoc
37+
- name: Setup pandoc from r-lib
38+
uses: r-lib/actions/setup-pandoc@v2
39+
40+
## R is already included in the Bioconductor docker images
41+
- name: Setup R from r-lib
42+
uses: r-lib/actions/setup-r@v2
43+
with:
44+
r-version: ${{ matrix.config.r }}
45+
rtools-version: ${{ matrix.config.rtools-version }}
46+
47+
## remotes, devtools
48+
- name: Query dependencies
49+
run: |
50+
install.packages('remotes')
51+
install.packages('devtools')
52+
shell: Rscript {0}
53+
54+
## BiocManager
55+
- name: Install BiocManager
56+
run: |
57+
remotes::install_cran("BiocManager")
58+
shell: Rscript {0}
59+
60+
# All Other dependencies
61+
- name: Install dependencies
62+
run: |
63+
## Try installing the package dependencies in steps. First the local
64+
## dependencies, then any remaining dependencies to avoid the
65+
## issues described at
66+
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
67+
## https://github.com/r-lib/remotes/issues/296
68+
## Ideally, all dependencies should get installed in the first pass.
69+
install.packages(c("rcmdcheck", "BiocCheck", "remotes"), repos = BiocManager::repositories())
70+
remotes::install_local(dependencies = TRUE, repos = BiocManager::repositories(), build_vignettes = FALSE, upgrade = TRUE)
71+
shell: Rscript {0}
72+
73+
# All Other dependencies
74+
- name: Install Suggested dependencies
75+
run: |
76+
BiocManager::install('RBioFormats')
77+
shell: Rscript {0}
78+
79+
## R CMD Check
80+
- name: Run CMD check
81+
env:
82+
_R_CHECK_CRAN_INCOMING_: false
83+
DISPLAY: 99.0
84+
run: |
85+
options(crayon.enabled = TRUE)
86+
rcmdcheck::rcmdcheck(
87+
args = c("--no-manual", "--no-vignettes", "--timings"),
88+
build_args = c("--no-manual", "--keep-empty-dirs", "--no-resave-data"),
89+
error_on = "error",
90+
check_dir = "check"
91+
)
92+
shell: Rscript {0}

0 commit comments

Comments
 (0)