Skip to content

Commit 3945b7e

Browse files
committed
add renv lock file to reproduce env
1 parent ee845dd commit 3945b7e

File tree

5 files changed

+11517
-1
lines changed

5 files changed

+11517
-1
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SCM syntax highlighting & preventing 3-way merges
2+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: R Restore and Run
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
r-restore:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
RENV_PATHS_ROOT: ~/.local/share/renv # persistent cache location
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up R
21+
uses: r-lib/actions/setup-r@v2
22+
23+
- name: Cache R packages (renv)
24+
uses: actions/cache@v4
25+
with:
26+
path: ${{ env.RENV_PATHS_ROOT }}
27+
key: ${{ runner.os }}-renv-${{ hashFiles('renv.lock') }}
28+
restore-keys: |
29+
${{ runner.os }}-renv-
30+
31+
- name: Restore environment from renv.lock
32+
run: |
33+
install.packages("renv", repos = "https://cloud.r-project.org")
34+
renv::restore(prompt = FALSE)
35+
shell: Rscript {0}
36+
37+
- name: Get data
38+
run: Rscript visium/download-test-data.R
39+
40+
- name: Run visium quality assessment
41+
run: Rscript visium/01_quality_assessment/quality_assessment.qmd

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@
44
**qs
55
**rds
66
**html
7-
*results*
7+
*results*
8+
# pixi environments
9+
.pixi
10+
*.egg-info

install_dependencies.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
options(repos = c(CRAN = "https://cloud.r-project.org"))
2+
options(BioC_mirror = "https://bioconductor.org")
3+
14
install.packages("BiocManager")
25
BiocManager::install("renv")
36
BiocManager::install(renv::dependencies(path = ".")[["Package"]])
47
BiocManager::install("dmcable/spacexr")
58
BiocManager::install("prabhakarlab/Banksy")
69
BiocManager::install("satijalab/seurat-wrappers")
10+
11+
# Only scan "scripts/" and "analysis.R"
12+
renv::snapshot(
13+
prompt = FALSE,
14+
packages = renv::dependencies(path = ".")[["Package"]]
15+
)

0 commit comments

Comments
 (0)