Skip to content

Commit c0ddd5c

Browse files
committed
Merge branch 'r-1.3-2' into production
2 parents aaa721f + e82d7b5 commit c0ddd5c

File tree

8 files changed

+64
-60
lines changed

8 files changed

+64
-60
lines changed

.travis.yml

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
2+
# Default configuration for use with tic package
3+
# Usually you shouldn't need to change the first part of the file
4+
5+
# DO NOT CHANGE THE CODE BELOW
6+
before_install: R -q -e 'install.packages(c("remotes", "curl")); remotes::install_github("ropenscilabs/tic"); tic::prepare_all_stages(); tic::before_install()'
7+
install: R -q -e 'tic::install()'
8+
after_install: R -q -e 'tic::after_install()'
9+
before_script: R -q -e 'tic::before_script()'
10+
script: R -q -e 'tic::script()'
11+
after_success: R -q -e 'tic::after_success()'
12+
after_failure: R -q -e 'tic::after_failure()'
13+
before_deploy: R -q -e 'tic::before_deploy()'
14+
deploy:
15+
provider: script
16+
script: R -q -e 'tic::deploy()'
17+
on:
18+
all_branches: true
19+
after_deploy: R -q -e 'tic::after_deploy()'
20+
after_script: R -q -e 'tic::after_script()'
21+
# DO NOT CHANGE THE CODE ABOVE
22+
23+
# Custom parts:
224

325
# Header
426
language: r
527
sudo: false
628
dist: trusty
729
cache: packages
8-
warnings_are_errors: true
30+
latex: false
931

1032
#env
1133
env:
1234
global:
1335
- _R_CHECK_FORCE_SUGGESTS_=false
1436
- MAKEFLAGS="-j 2"
1537

16-
#addons
17-
addons:
18-
apt:
19-
packages:
20-
- libmagick++-dev
21-
- libssh2-1-dev
22-
2338
#matrix: 3x Linux, 1x OS X
2439
matrix:
2540
include:
@@ -33,37 +48,6 @@ matrix:
3348
r: release
3449
latex: false
3550

36-
#notifications
37-
notifications:
38-
email:
39-
on_success: change
40-
on_failure: change
41-
42-
#before_script
43-
before_script:
44-
- R -q -e 'devtools::install_github("ropenscilabs/tic"); tic::prepare_all_stages()'
45-
46-
#after_success
47-
after_success:
48-
- R -q -e 'tic::after_success()'
49-
50-
#deploy // https://github.com/travis-ci/travis-build/blob/85ef7108/lib/travis/build/addons/deploy/script.rb#L100-L107
51-
deploy:
52-
provider: script
53-
script: R -q -e 'tic::deploy()'
54-
on:
55-
all_branches: true
56-
57-
# Custom parts:
58-
59-
#r_github_packages
60-
r_github_packages:
61-
62-
#r_packages
63-
r_packages:
6451

6552
#services
6653
services:
67-
68-
#before_install
69-
before_install:

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rprojroot
22
Title: Finding Files in Project Subdirectories
3-
Version: 1.3-1
3+
Version: 1.3-2
44
Authors@R: person(given = "Kirill", family = "Müller", role = c("aut",
55
"cre"), email = "krlmlr+r@mailbox.org")
66
Description: Robust, reliable and flexible paths to files below a

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## rprojroot 1.3-2 (2017-12-22)
2+
3+
- Availability of suggested packages knitr and rmarkdown, and pandoc, is now checked before running the corresponding tests.
4+
5+
16
# rprojroot 1.3-1 (2017-12-18)
27

38
- Adapt to testthat 2.0.0.

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<!-- README.md is generated from README.Rmd. Please edit that file -->
2-
[rprojroot](https://krlmlr.github.io/rprojroot) [![Travis-CI Build Status](https://travis-ci.org/krlmlr/rprojroot.svg?branch=master)](https://travis-ci.org/krlmlr/rprojroot) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/rprojroot)](https://cran.r-project.org/package=rprojroot)
3-
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
2+
[rprojroot](https://krlmlr.github.io/rprojroot)
3+
===============================================
4+
5+
[![Travis-CI Build Status](https://travis-ci.org/krlmlr/rprojroot.svg?branch=master)](https://travis-ci.org/krlmlr/rprojroot) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/rprojroot)](https://cran.r-project.org/package=rprojroot)
46

57
This package helps accessing files relative to a *project root* to [stop the working directory insanity](https://gist.github.com/jennybc/362f52446fe1ebc4c49f).
68

@@ -18,12 +20,13 @@ How do we access the package root? In a robust fashion? Easily:
1820

1921
``` r
2022
dir(rprojroot::find_root("DESCRIPTION"))
21-
#> [1] "appveyor.yml" "cran-comments.md" "DESCRIPTION"
22-
#> [4] "docs" "inst" "Makefile"
23-
#> [7] "man" "NAMESPACE" "NEWS.md"
24-
#> [10] "_pkgdown.yml" "R" "readme"
25-
#> [13] "README.md" "rprojroot.Rproj" "scripts"
26-
#> [16] "tests" "vignettes"
23+
#> [1] "_pkgdown.yml" "API" "appveyor.yml"
24+
#> [4] "cran-comments.md" "DESCRIPTION" "docs"
25+
#> [7] "inst" "Makefile" "man"
26+
#> [10] "NAMESPACE" "NEWS.md" "R"
27+
#> [13] "readme" "README.md" "revdep"
28+
#> [16] "rprojroot.Rproj" "tests" "tic.R"
29+
#> [19] "vignettes"
2730
```
2831

2932
Installation and further reading

cran-comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Resumbission upon CRAN's request, to fix brittle tests.
1+
Resumbission upon CRAN's request, to fix brittle tests (again).
22

33
## Test environments
44
* local Ubuntu install, R 3.4.3

readme/README.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ knitr::opts_chunk$set(
1818
)
1919
```
2020

21-
[rprojroot](https://krlmlr.github.io/rprojroot) [![Travis-CI Build Status](https://travis-ci.org/krlmlr/rprojroot.svg?branch=master)](https://travis-ci.org/krlmlr/rprojroot) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rprojroot)](https://cran.r-project.org/package=rprojroot)
22-
=================================================================================================================================================================================================================================================================================================================================================
21+
# [rprojroot](https://krlmlr.github.io/rprojroot)
22+
23+
[![Travis-CI Build Status](https://travis-ci.org/krlmlr/rprojroot.svg?branch=master)](https://travis-ci.org/krlmlr/rprojroot) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/krlmlr/rprojroot?branch=master&svg=true)](https://ci.appveyor.com/project/krlmlr/rprojroot) [![codecov.io](https://codecov.io/github/krlmlr/rprojroot/coverage.svg?branch=master)](https://codecov.io/github/krlmlr/rprojroot?branch=master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rprojroot)](https://cran.r-project.org/package=rprojroot)
2324

2425
This package helps accessing files relative to a *project root* to [stop the working directory insanity](https://gist.github.com/jennybc/362f52446fe1ebc4c49f).
2526

tests/testthat/test-thisfile.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
context("thisfile")
22

33
test_that("thisfile works with source", {
4+
skip_on_cran()
45
res <- source("scripts/thisfile.R")
56
expect_true(grepl("thisfile.R$", res$value))
67
})
78

89
test_that("thisfile works with Rscript", {
10+
skip_on_cran()
911
p <- pipe("Rscript scripts/thisfile-cat.R")
1012
on.exit(close(p))
1113
res <- readLines(p)
1214
expect_equal("scripts/thisfile-cat.R", res[[length(res)]])
1315
})
1416

1517
test_that("thisfile works with R", {
18+
skip_on_cran()
1619
p <- pipe("R --slave --vanilla --no-save -f scripts/thisfile-cat.R")
1720
on.exit(close(p))
1821
res <- readLines(p)
1922
expect_equal("scripts/thisfile-cat.R", res[[length(res)]])
2023
})
2124

2225
test_that("thisfile works with knitr", {
26+
skip_if_not_installed("knitr")
2327
out <- tempfile(pattern = "rprojroot", fileext = ".md")
2428
expect_message(
2529
knitr::knit("scripts/thisfile.Rmd", output = out, quiet = TRUE),
@@ -29,6 +33,9 @@ test_that("thisfile works with knitr", {
2933
})
3034

3135
test_that("thisfile works with rmarkdown", {
36+
skip_if_not_installed("rmarkdown")
37+
skip_if_not(rmarkdown::pandoc_available())
38+
3239
out <- tempfile(pattern = "rprojroot", fileext = ".md")
3340
expect_message(
3441
rmarkdown::render(

tic.R

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
get_stage("after_success") %>%
2-
add_step(step_hello_world()) %>%
3-
add_step(step_run_code(covr::codecov()))
1+
add_package_checks()
42

5-
get_stage("deploy") %>%
6-
add_step(step_add_to_known_hosts("github.com")) %>%
7-
add_step(step_install_ssh_keys()) %>%
8-
add_step(step_test_ssh())
3+
if (inherits(ci(), "TravisCI") && Sys.getenv("BUILD_PKGDOWN") != "" && Sys.getenv("id_rsa") != "") {
4+
# pkgdown documentation can be built optionally. Other example criteria:
5+
# - `inherits(ci(), "TravisCI")`: Only for Travis CI
6+
# - `ci()$is_tag()`: Only for tags, not for branches
7+
# - `Sys.getenv("BUILD_PKGDOWN") != ""`: If the env var "BUILD_PKGDOWN" is set
8+
# - `Sys.getenv("TRAVIS_EVENT_TYPE") == "cron"`: Only for Travis cron jobs
9+
get_stage("before_deploy") %>%
10+
add_step(step_setup_ssh())
911

10-
if (ci()$get_branch() == "production" && Sys.getenv("BUILD_PKGDOWN") != "") {
1112
get_stage("deploy") %>%
1213
add_step(step_build_pkgdown(examples = FALSE)) %>%
13-
add_step(step_push_deploy(path = "docs", branch = "gh-pages"))
14+
add_step(step_push_deploy(
15+
path = "docs",
16+
branch = if (ci()$get_branch() == "master") "gh-pages" else paste0("gh-pages-", ci()$get_branch())
17+
))
1418
}

0 commit comments

Comments
 (0)