-
-
Notifications
You must be signed in to change notification settings - Fork 19
167 lines (144 loc) · 6.51 KB
/
R-CMD-check-bioc.yaml
File metadata and controls
167 lines (144 loc) · 6.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Based on workflows from https://github.com/Huber-group-EMBL/rhdf5
# Uses steps from https://github.com/grimbough/bioc-actions
on:
push:
branches:
- devel
pull_request:
name: R-CMD-check-bioc
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
jobs:
R-CMD-check-bioc:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.bioc-version }})
strategy:
fail-fast: false
matrix:
config:
- { os: windows-latest, bioc-version: 'devel', bioc-mirror: 'https://bioconductor.posit.co/', cache: 1 }
- { os: macOS-latest, bioc-version: 'devel', bioc-mirror: 'https://bioconductor.posit.co/', cache: 1 }
- { os: macOS-15-intel, bioc-version: 'devel', bioc-mirror: 'https://bioconductor.posit.co/', cache: 2 }
- { os: ubuntu-latest, bioc-version: 'devel', bioc-mirror: 'https://bioconductor.posit.co/', cache: 1 }
- { os: ubuntu-latest, bioc-version: 'release', bioc-mirror: 'https://packagemanager.posit.co/bioconductor', cache: 1 }
steps:
## R CMD check complains about Windows line endings without this
- name: Configure git
run: |
git config --global core.autocrlf false
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install hdf5-tools libsz2 libaec-dev
## Workaround: data.table (indirect dep via Seurat) fails to compile
## on macOS ARM because libintl.h is missing.
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install gettext
mkdir -p ~/.R
echo "CPPFLAGS += -I$(brew --prefix gettext)/include" >> ~/.R/Makevars
echo "LDFLAGS += -L$(brew --prefix gettext)/lib" >> ~/.R/Makevars
- name: Setup R and Bioconductor
# todo: remove this workaround line once it is working for windows and/or mac os x
if: matrix.config.os != 'windows-latest' && matrix.config.os != 'macOS-latest'
uses: grimbough/bioc-actions/setup-bioc@v1
with:
bioc-version: ${{ matrix.config.bioc-version }}
bioc-mirror: ${{ matrix.config.bioc-mirror }}
## windows-latest and macOS-latest (ARM) hit a bug in R-devel (commit
## dd03406, 2026-04-09) where BiocManager::install() crashes via
## old.packages(type="both") -> .available.both() -> subscript out of
## bounds. Work around by setting up R manually and calling
## BiocManager::install(update=FALSE) to skip the old.packages() call.
- name: Setup R (Windows/macOS-ARM devel)
if: matrix.config.os == 'windows-latest' || matrix.config.os == 'macOS-latest'
uses: r-lib/actions/setup-r@v2
with:
r-version: devel
rtools-version: 45
use-public-rspm: true
- name: Setup Bioconductor (Windows/macOS-ARM devel)
if: matrix.config.os == 'windows-latest' || matrix.config.os == 'macOS-latest'
shell: Rscript {0}
run: |
download.file(
'https://bioconductor.org/checkResults/devel/bioc-LATEST/Renviron.bioc',
destfile = '~/.Renviron', mode = 'wb')
write(
'options(BioC_mirror = "${{ matrix.config.bioc-mirror }}")',
file = '~/.Rprofile', append = TRUE)
install.packages(c("BiocManager", "remotes"), quiet = TRUE)
## update=FALSE avoids calling old.packages(type="both") which
## triggers the R-devel bug in .available.both() (commit dd03406)
BiocManager::install(version = "3.23", ask = FALSE, update = FALSE)
cat("R_BIOC_VERSION=3.23\n", file = Sys.getenv("GITHUB_ENV"), append = TRUE)
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: ${{ matrix.config.cache }}
extra-packages: any::rcmdcheck
needs: check
## Workaround: llvmlite has no pre-built pip wheel on macOS x86_64,
## but conda-forge does have a build. Use reticulate + conda to install.
## See https://github.com/numba/numba/issues/10187#issuecomment-3800638403
- name: Cache conda packages (macOS Intel)
if: matrix.config.os == 'macOS-15-intel'
uses: actions/cache@v5
with:
path: ~/.local/share/r-miniconda
key: ${{ runner.os }}-conda-${{ hashFiles('DESCRIPTION') }}
restore-keys: |
${{ runner.os }}-conda-
- name: Install Python packages via conda (macOS Intel)
id: install-conda
if: matrix.config.os == 'macOS-15-intel'
shell: Rscript {0}
run: |
reticulate::install_miniconda()
reticulate::py_install(
c("scanpy", "mudata"),
method = "conda",
channel = "conda-forge"
)
# need to store this in Renviron because there's no easy way of
# passing env vars to bioc-actions/build-install-check
writeLines(
paste0("RETICULATE_PYTHON=", reticulate::conda_python("r-reticulate")),
"~/.Renviron"
)
- name: Verify conda installation (macOS Intel)
if: matrix.config.os == 'macOS-15-intel'
shell: Rscript {0}
run: |
stopifnot(reticulate::py_module_available("scanpy"))
stopifnot(reticulate::py_module_available("mudata"))
cat("Python packages verified successfully\n")
- name: Bioc - Build, Install, Check
id: bioc-check
uses: grimbough/bioc-actions/build-install-check@v1
- name: Show testthat output
if: always()
run: find .. -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload check results
if: failure() && steps.bioc-check.outputs.check-dir != ''
uses: actions/upload-artifact@v7
with:
name: ${{ format('{0}-{1}-bioc-{2}-results', runner.os, runner.arch, env.R_BIOC_VERSION) }}
path: ${{ steps.bioc-check.outputs.check-dir }}
- name: Run BiocCheck
if: matrix.config.os == 'ubuntu-latest' && matrix.config.bioc-version == 'devel'
uses: grimbough/bioc-actions/run-BiocCheck@v1
with:
error-on: 'never'
arguments: '--no-check-bioc-help'