Skip to content

Commit

Permalink
work on #85
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Nov 22, 2018
1 parent f4b6d1f commit a9b6f01
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/external_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ setup_repo <- function(git_service, login,
}

if (ci_activation == "travis") {
usethis::use_travis()
usethis::use_template("dot-travis.yml",
target = ".travis.yml",
package = "travis")
travis::travis_enable()
# copy custom tic depending on proj
# if sthg
travis::use_travis_deploy()
# in all cases
travis::travis_set_pat()

add_travis_badge(login, name)
}
}
Expand Down
34 changes: 34 additions & 0 deletions inst/templates/tic/package/tic.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
add_package_checks()

get_stage("after_success") %>%
add_code_step(covr::{{coverage_service}}(quiet = FALSE))

if (Sys.getenv("id_rsa") != "") {
# pkgdown documentation can be built optionally. Other example criteria:
# - `inherits(ci(), "TravisCI")`: Only for Travis CI
# - `ci()$is_tag()`: Only for tags, not for branches
# - `Sys.getenv("BUILD_PKGDOWN") != ""`: If the env var "BUILD_PKGDOWN" is set
# - `Sys.getenv("TRAVIS_EVENT_TYPE") == "cron"`: Only for Travis cron jobs
get_stage("before_deploy") %>%
add_step(step_setup_ssh())

if (ci()$get_branch() == "master") {
get_stage("deploy") %>%
add_code_step(covr::codecov()) %>%
add_code_step(remotes::install("lockedata/pRojects")) %>%
add_code_step(install.packages("spelling")) %>%
add_code_step(covrpage::covrpage_ci()) %>%
add_step(step_push_deploy(commit_paths = "tests/README.md")) %>%
add_step(step_build_pkgdown()) %>%
add_step(step_push_deploy(path = "docs", branch = "gh-pages")) %>%
add_code_step(library("pRojects"))%>%
add_code_step(get_project_health()) %>%
add_step(step_push_deploy(path = "health", branch = "project-health"))
}else{
get_stage("deploy") %>%
add_code_step(covr::codecov()) %>%
add_code_step(devtools::install()) %>%
add_code_step(covrpage::covrpage_ci()) %>%
add_step(step_push_deploy(commit_paths = "tests/README.md"))
}
}

0 comments on commit a9b6f01

Please sign in to comment.