File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 66^\.github$
77^\.git$
88^cran-comments\.md$
9-
9+ ^Makefile$
Original file line number Diff line number Diff line change 1+ # Use the CRAN debian image as the base
2+ FROM --platform=linux/amd64 ghcr.io/r-devel/rcheckserver/debian:latest
3+
4+ # Set a working directory for the build
5+ WORKDIR /build
6+
7+ # Copy only the DESCRIPTION file first
8+ # This ensures R doesn't rebuild this layer unless dependencies change
9+ COPY DESCRIPTION .
10+
11+ # Install the system requirements and R dependencies
12+ RUN R -e 'install.packages(c("remotes", "rcmdcheck"), repos="https://cloud.r-project.org")' \
13+ && R -e 'remotes::install_deps(dependencies = TRUE)'
14+
15+ # Clean up the build directory
16+ WORKDIR /workdir
Original file line number Diff line number Diff line change 1+ IMAGE_NAME =bayesmallows-check-env
2+ PLATFORM =linux/amd64
3+ VOL =-v "$(shell pwd) ":/workdir
4+ WORKDIR =-w /workdir
5+
6+ .PHONY : build-env check-debian shell clean
7+
8+ # 1. Build the environment (run this when DESCRIPTION changes)
9+ build-env :
10+ docker build --platform $(PLATFORM ) -t $(IMAGE_NAME ) .
11+
12+ # 2. Run the check (fast, uses cached dependencies)
13+ check-debian :
14+ docker run --rm $(VOL ) $(WORKDIR ) --platform $(PLATFORM ) $(IMAGE_NAME ) \
15+ bash -c " R CMD build . && R CMD check BayesMallowsSMC2_*.tar.gz"
16+
17+ # 3. Debugging shell
18+ shell :
19+ docker run --rm -it $(VOL ) $(WORKDIR ) --platform $(PLATFORM ) $(IMAGE_NAME ) /bin/bash
20+
21+ # 4. Clean up check artifacts
22+ clean :
23+ rm -rf * .Rcheck/
24+ rm -f * .tar.gz
You can’t perform that action at this time.
0 commit comments