-
Notifications
You must be signed in to change notification settings - Fork 3
173 lines (148 loc) · 7.28 KB
/
R-CMD-check.yaml
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
168
169
170
171
172
173
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
workflow_dispatch:
push:
branches: [ master, dev ]
pull_request:
schedule:
- cron: "0 6 * * 3"
name: R Build and Checks
jobs:
R-CMD-check:
runs-on: ubuntu-${{ matrix.config.os }}
name: ubuntu-${{ matrix.config.os }} (${{ matrix.config.r }} / ${{ matrix.config.bioc }})
strategy:
fail-fast: false
matrix:
config:
#- { os: 24.04, r: 'devel', bioc: '3.21' } # Bioc 3.21 (devel) requires R 4.5
- { os: 24.04, r: '4.4', bioc: '3.20', pkgdown: "true" }
- { os: 22.04, r: '4.3', bioc: '3.18' }
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-pandoc@v2
- name: Install pdflatex
run: sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra
- name: Install packages
if: runner.os != 'Windows'
# libharfbuzz-dev libfribidi-dev are added to fix textshaping install error
# libhdf5-dev added for cellmembrane/SeuratDisk
# libglpk-dev added due to igraph / bluster /scran error
# NOTE: added numpy<2 to side-step a numpy version issue. This should be removed eventually. See: https://github.com/numpy/numpy/issues/26710
run: |
# NOTE: libsodium-dev installed for VISION
sudo apt-get update && sudo apt-get install -yq libharfbuzz-dev libfribidi-dev python3 python3-pip libsodium-dev libcurl4-openssl-dev libglpk-dev libhdf5-dev libmagick++-dev
sudo apt-get update
sudo apt-get install -yq libharfbuzz-dev libfribidi-dev libsodium-dev libcurl4-openssl-dev python3 python3-pip
python3 -m pip install --user wheel setuptools
python3 -m pip install --user "numpy<2.0.0"
python3 -m pip install --user umap-learn phate sctour tcrdist3 scikit-misc leidenalg
- name: Setup CoNGA
run: |
python3 -m pip install --user scanpy
cd ../
git clone https://github.com/phbradley/conga.git conga
cd conga/tcrdist_cpp
make
cd ../../
pip3 install -e conga
cd CellMembrane
- name: Setup SDA
run: |
SDA_PATH=/home/runner/work/sda
mkdir $SDA_PATH
wget -q -O $SDA_PATH/sda_static_linux https://www.dropbox.com/sh/chek4jkr28qnbrj/AADPy1qQlm3jsHPmPdNsjSx2a/bin/sda_static_linux?dl=1
chmod +x $SDA_PATH/sda_static_linux
echo /home/runner/work/sda >> $GITHUB_PATH
# Note: the environment variable R_BIOC_VERSION is set to force remotes::install_bioc to follow the proper version
- name: Setup Bioconductor
run: |
install.packages('devtools')
if (!requireNamespace("BiocManager", quietly=TRUE)) install.packages("BiocManager");
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE);
cat(append = TRUE, file = "~/.Rprofile", "options(repos = BiocManager::repositories());")
cat(append = TRUE, file = "~/.Rprofile", "Sys.setenv(R_BIOC_VERSION=as.character(BiocManager::version()));");
shell: Rscript {0}
- name: Query dependencies
run: |
install.packages('remotes')
print(paste0("R_BIOC_VERSION: ", Sys.getenv("R_BIOC_VERSION")));
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ matrix.config.bioc }}-${{ secrets.CACHE_VERSION || 1 }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ matrix.config.bioc }}-${{ secrets.CACHE_VERSION || 1 }}-
# The install_github() on remotes is to ensure system_requirements() supports 22.04
- name: Install r-lib/remotes
run: |
remotes::install_github("r-lib/remotes", force = TRUE)
print(paste0("Remotes version: ", packageVersion("remotes")))
shell: Rscript {0}
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "${{ matrix.config.os }}"))')
- name: Install dependencies
run: |
getOption('repos');
print(paste0("R_BIOC_VERSION: ", Sys.getenv("R_BIOC_VERSION")));
remotes::install_deps(dependencies = TRUE, upgrade = 'always')
# See: https://stackoverflow.com/questions/77370659/error-failed-to-collect-lazy-table-caused-by-error-in-db-collect-using
# TODO: Updating to BiocFileCache 2.10.1 should ultimately fix this. This manifests in SingleR
if (Sys.getenv("R_BIOC_VERSION") < '3.18') { devtools::install_version("dbplyr", version = "2.3.4") }
# TODO: this is to fix the as_cholmod_sparse' not provided by package 'Matrix' errors. This should ultimately be removed
install.packages('Matrix', type = 'source', force = TRUE, repos = 'https://cran.wustl.edu/')
install.packages('irlba', type = 'source', force = TRUE, repos = 'https://cran.wustl.edu/')
install.packages("pkgdown")
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Verify SDA
run: |
which sda_static_linux
- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-bioc${{ matrix.config.bioc }}-results
path: check
- name: Install package
if: github.ref == 'refs/heads/master' && matrix.config.pkgdown == 'true'
run: R CMD INSTALL .
- name: Deploy package
if: github.ref == 'refs/heads/master' && matrix.config.pkgdown == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)'