Skip to content

Commit

Permalink
Merge pull request #46 from karthik/update_r_versions
Browse files Browse the repository at this point in the history
Update r versions
  • Loading branch information
karthik authored Apr 9, 2020
2 parents dc8831c + ae3c5c9 commit 32479f8
Show file tree
Hide file tree
Showing 17 changed files with 149 additions and 83 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ man-roxygen/
holepunch.png
^appveyor\.yml$
^codemeta\.json$
.coveralls.yml
.coveralls.yml
generate_version_dates.R
81 changes: 81 additions & 0 deletions .github/R-CMD-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '3.6'}
- {os: macOS-latest, r: '3.6'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: '3.2', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ inst/doc
.*
!/.gitignore
.Rproj.user
generate_version_dates.R
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: holepunch
Title: Configure Your R Project for 'binderhub'
Version: 0.1.26.9000
Version: 0.1.27.9000
Authors@R:
c(person(given = "Karthik",
family = "Ram",
Expand All @@ -26,6 +26,7 @@ Imports:
gh,
git2r (>= 0.23),
glue,
here,
httr,
lubridate,
promises,
Expand All @@ -35,7 +36,7 @@ Imports:
Remotes: rstudio/renv
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
Suggests:
testthat (>= 2.1.0),
covr,
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
7 changes: 5 additions & 2 deletions R/write_compendium_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ write_compendium_description <-
description = "Compendium description",
version = "0.0.1",
path = ".") {

# browser()

Depends <- unique(get_dependencies(path))
if(is.null(Depends))
Expand All @@ -45,7 +47,7 @@ write_compendium_description <-
if (length(remote_pkgs > 0)) {
fields <-
list(
Type = type,
Type = "Compendium",
Package = package,
Version = version,
Description = description,
Expand All @@ -59,7 +61,7 @@ write_compendium_description <-
} else {
fields <-
list(
Type = type,
Type = "Compendium",
Package = package,
Version = version,
Description = description,
Expand All @@ -82,6 +84,7 @@ write_compendium_description <-
desc <- build_desc(fields)
desc <- desc::description$new(text = desc)


tidy_desc(desc)
lines <-
desc$str(by_field = TRUE,
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Hole punch

[![Travis build status](https://travis-ci.org/karthik/holepunch.svg?branch=master)](https://travis-ci.org/karthik/holepunch)
[![Build status](https://ci.appveyor.com/api/projects/status/iowqitu84h9dquro?svg=true)](https://ci.appveyor.com/project/karthik/holepunch)
<!-- badges: start -->
[![R build status](https://github.com/karthik/holepunch/workflows/R-CMD-check/badge.svg)](https://github.com/karthik/holepunch)
<!-- badges: end -->
[![Coveralls test coverage](https://coveralls.io/repos/github/karthik/holepunch/badge.svg)](https://coveralls.io/r/karthik/holepunch?branch=master)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![CRAN status](http://www.r-pkg.org/badges/version/holepunch)](https://www.r-pkg.org/badges/version/holepunch)
Expand Down
52 changes: 0 additions & 52 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
],
"releaseNotes": "https://github.com/karthik/holepunch/blob/master/NEWS.md",
"readme": "https://github.com/karthik/holepunch/blob/master/README.md",
"fileSize": "21.266KB",
"fileSize": "21.058KB",
"contIntegration": [
"https://travis-ci.org/karthik/holepunch",
"https://coveralls.io/r/karthik/holepunch?branch=master",
Expand Down
8 changes: 6 additions & 2 deletions man/generate_badge.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/write_compendium_description.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions man/write_dockerfile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/write_runtime.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions tests/testthat/common.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
source('test-fns.R')
source(test_path('test-fns.R'))

randdd <- rand_str_foo()
# Tempdir never goes away and I need to start clean each time
# Hence the random dir
temp_path <- glue::glue("{tempdir()}/{randdd}/testcompendium")
dir.create(temp_path, showWarnings = FALSE)

# randdd <- rand_str_foo()
# # Tempdir never goes away and I need to start clean each time
# # Hence the random dir
# temp_path <- glue::glue("{tempdir()}/{randdd}/testcompendium")
# dir.create(temp_path, showWarnings = FALSE)
old_path <- getwd()
temp_path <- tempfile()
dir_empty(temp_path)
# Note: suppressing warnings here because if I don't I see this:
# warning: `recursive` is deprecated, please use `recurse` instead
suppressWarnings(usethis::create_project(path = temp_path, open = FALSE))
#usethis::create_project(path = temp_path, open = FALSE)
# TODO: Problem above:
# ----------------------------------------------------
setwd(temp_path)
git2r::init(temp_path)

Expand Down Expand Up @@ -41,4 +46,4 @@ cat(
"```{r}\nlibrary(dplyr)\nrequire(ggplot2)\nglue::glue_collapse(glue::glue('{1:10}'))\n```\n",
file = paste0(temp_path, "/test.Rmd")
)
setwd(temp_path)
on.exit(setwd(temp_path))
2 changes: 1 addition & 1 deletion tests/testthat/teardown-holepunch.R
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unlink("tests/testthat/dir_code/.binder")
unlink(test_path("dir_code/.binder"), recursive = TRUE)
13 changes: 11 additions & 2 deletions tests/testthat/test-fns.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
rand_str_foo <- function() {
paste(sample(c(0:9, letters, LETTERS), 12, replace = TRUE), collapse = "")
}
paste(sample(c(0:9, letters, LETTERS), 4, replace = TRUE), collapse = "")
}


dir_empty <- function(x) {
unlink(x, recursive = TRUE, force = TRUE)
dir.create(x)
}



4 changes: 2 additions & 2 deletions tests/testthat/test-write_compendium_description.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("A Description is written correctly", {
source("common.R")
source(testthat::test_path("common.R"))
write_compendium_description(package = "FOOBAR", description = "BARFOO")

rendered_file <- readLines(glue::glue("{temp_path}/DESCRIPTION"))
Expand Down Expand Up @@ -28,5 +28,5 @@ test_that("Write Compendium Description", {
close(fileConn)
write_compendium_description(path = temp_path)
expect_true(fs::file_exists(glue("{temp_path}/DESCRIPTION")))
unlink(temp_path)
unlink(temp_path)
})

0 comments on commit 32479f8

Please sign in to comment.