diff --git a/.Rbuildignore b/.Rbuildignore index b8a674fa..bfce554a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -16,3 +16,4 @@ ^tools/dist$ ^compile_commands\.json$ ^\.cache$ +^docker-compose\.yml$ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..82df6ffc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + ubuntu-focal: + build: + context: . + dockerfile: tools/docker/ubuntu-focal.dockerfile + volumes: + - .:/s2 + command: bash diff --git a/tests/testthat/test-s2-cell.R b/tests/testthat/test-s2-cell.R index 27a938df..fb02b7a0 100644 --- a/tests/testthat/test-s2-cell.R +++ b/tests/testthat/test-s2-cell.R @@ -11,6 +11,8 @@ test_that("s2_cell class works", { }) test_that("s2_cell bit64::integer64 support works", { + skip_if_not_installed("bit64") + cells <- c(as_s2_cell(NA_character_), s2_cell_sentinel()) int64s <- bit64::as.integer64(cells) expect_identical(int64s, bit64::as.integer64(c(NA, -1))) diff --git a/tools/docker/ubuntu-focal.dockerfile b/tools/docker/ubuntu-focal.dockerfile new file mode 100644 index 00000000..37b5953b --- /dev/null +++ b/tools/docker/ubuntu-focal.dockerfile @@ -0,0 +1,12 @@ + +FROM ubuntu:focal + +ENV TZ=UTC +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + r-base cmake \ + libudunits2-dev libgdal-dev libgeos-dev libproj-dev \ + libcurl4-openssl-dev libssl-dev + +# Make sure we can use all cores to install things +RUN mkdir ~/.R && echo "MAKEFLAGS = -j$(nproc)" > ~/.R/Makevars +RUN R -e 'install.packages(c("wk", "Rcpp", "testthat"), repos = "https://cloud.r-project.org")'