Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add continuous integration on Appveyor/Travis using tic
- Loading branch information
Showing
5 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# R for travis: https://docs.travis-ci.com/user/languages/r | ||
# tic https://ropenscilabs.github.io/tic/ | ||
|
||
before_install: R -q -e 'install.packages("remotes"); remotes::install_github("bnosac-dev/tic"); tic::before_install()' | ||
install: R -q -e 'tic::install()' | ||
after_install: R -q -e 'tic::after_install()' | ||
before_script: R -q -e 'tic::before_script()' | ||
script: R -q -e 'tic::script()' | ||
after_success: R -q -e 'tic::after_success()' | ||
after_failure: R -q -e 'tic::after_failure()' | ||
before_deploy: R -q -e 'tic::before_deploy()' | ||
deploy: | ||
provider: script | ||
script: R -q -e 'tic::deploy()' | ||
on: | ||
all_branches: true | ||
after_deploy: R -q -e 'tic::after_deploy()' | ||
after_script: R -q -e 'tic::after_script()' | ||
|
||
## | ||
## Custom parts: | ||
## | ||
language: r | ||
latex: true | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
dist: xenial | ||
r: oldrel | ||
- os: linux | ||
dist: xenial | ||
r: release | ||
- os: osx | ||
r: oldrel | ||
- os: osx | ||
r: release | ||
|
||
brew_packages: | ||
- libgit2 | ||
- openssl | ||
- imagemagick | ||
- gs | ||
|
||
addons: | ||
apt: | ||
update: true | ||
sources: | ||
- sourceline: 'ppa:opencpu/imagemagick' | ||
packages: | ||
- libgit2-dev | ||
- libssl-dev | ||
- libmagick++-dev | ||
- librsvg2-dev | ||
- libwebp-dev | ||
- libfftw3-dev | ||
|
||
notifications: | ||
email: | ||
on_success: change | ||
on_failure: change | ||
|
||
services: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Download script file from GitHub | ||
init: | ||
ps: | | ||
$ErrorActionPreference = "Stop" | ||
Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" | ||
Import-Module '..\appveyor-tool.ps1' | ||
install: | ||
- ps: Bootstrap | ||
- cmd: Rscript -e "writeLines('options(repos = \'https://cloud.r-project.org\')', '~/.Rprofile')" | ||
- cmd: Rscript -e "getOption('repos')" | ||
- cmd: Rscript -e "install.packages('remotes'); remotes::install_github('bnosac-dev/tic');" | ||
|
||
cache: | ||
- C:\RLibrary | ||
|
||
before_build: Rscript -e "tic::before_install()" | ||
build_script: Rscript -e "tic::install()" | ||
after_build: Rscript -e "tic::after_install()" | ||
before_test: Rscript -e "tic::before_script()" | ||
test_script: Rscript -e "tic::script()" | ||
on_success: Rscript -e "try(tic::after_success(), silent = TRUE)" | ||
on_failure: Rscript -e "tic::after_failure()" | ||
before_deploy: Rscript -e "tic::before_deploy()" | ||
deploy_script: Rscript -e "tic::deploy()" | ||
after_deploy: Rscript -e "tic::after_deploy()" | ||
on_finish: Rscript -e "tic::after_script()" | ||
|
||
# Adapt as necessary starting from here | ||
|
||
#on_failure: | ||
# - 7z a failure.zip *.Rcheck\* | ||
# - appveyor PushArtifact failure.zip | ||
|
||
environment: | ||
USE_RTOOLS: true | ||
R_BUILD_ARGS: --no-manual | ||
R_CHECK_ARGS: --no-manual --as-cran | ||
matrix: | ||
- R_VERSION: oldrel | ||
- R_VERSION: release | ||
|
||
artifacts: | ||
- path: '*.Rcheck\**\*.log' | ||
name: Logs | ||
|
||
- path: '*.Rcheck\**\*.out' | ||
name: Logs | ||
|
||
- path: '*.Rcheck\**\*.fail' | ||
name: Logs | ||
|
||
- path: '*.Rcheck\**\*.Rout' | ||
name: Logs | ||
|
||
- path: '\*_*.tar.gz' | ||
name: Bits | ||
|
||
- path: '\*_*.zip' | ||
name: Bits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## | ||
## CI keys (one-time) | ||
## | ||
|
||
library(openssl) | ||
encode_private_key <- function(key) { | ||
conn <- textConnection(NULL, "w") | ||
openssl::write_pem(key, conn, password = NULL) | ||
private_key <- textConnectionValue(conn) | ||
close(conn) | ||
private_key <- paste(private_key, collapse = "\n") | ||
openssl::base64_encode(charToRaw(private_key)) | ||
} | ||
key <- openssl::rsa_keygen() | ||
private_key <- encode_private_key(key) | ||
pub_key <- as.list(key)$pubkey | ||
|
||
## Print the id_rsa | ||
cat(list(title = "travis-ci_bnosac/image", key = openssl::write_ssh(pub_key))$key, sep = "\n") | ||
cat(private_key, sep = "\n") | ||
|
||
## | ||
## KEY: id_rsa | ||
## - on Github add the public key in the SSH tab | ||
## - on Travis add id_rsa to the private key on bnosac/image | ||
## - on Appveyor add id_rsa as private environment variable | ||
## | ||
## KEY: GITHUB_PAT | ||
## - on Github create Personal Access Token in Settings > Developer Settings | ||
## - on Travis add GITHUB_PAT as private environment variable on bnosac/image | ||
## - on Appveyor add GITHUB_PAT as private environment variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#if (Sys.getenv("id_rsa") != "" && ci()$get_branch() == "master") { | ||
# 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_install") %>% | ||
add_code_step(install.packages(c("rcmdcheck", "curl", "drat", "git2r", "knitr", "withr", "pkgbuild", "openssl"))) %>% | ||
add_code_step(install.packages(c("Rcpp", "magick", "pixmap", "dlib", "sp"))) | ||
|
||
get_stage("install") %>% add_code_step(cat("Nothing to do")) | ||
get_stage("after_install") %>% add_code_step(cat("Nothing to do")) | ||
get_stage("before_script") %>% add_code_step(cat("Nothing to do")) | ||
|
||
get_stage("script") %>% | ||
add_code_step(rcmdcheck::rcmdcheck("image.Otsu")) %>% | ||
add_code_step(rcmdcheck::rcmdcheck("image.CornerDetectionF9")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.CornerDetectionHarris")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.dlib")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.DenoiseNLMeans")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.darknet")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.CannyEdges")) %>% | ||
#add_code_step(rcmdcheck::rcmdcheck("image.OpenPano")) %>% | ||
add_code_step(rcmdcheck::rcmdcheck("image.LineSegmentDetector")) %>% | ||
add_code_step(rcmdcheck::rcmdcheck("image.ContourDetector")) | ||
|
||
get_stage("before_deploy") %>% | ||
add_step(step_setup_ssh()) | ||
|
||
get_stage("deploy") %>% | ||
add_step(step_setup_push_deploy(path = "~/git/drat", branch = "gh-pages", remote = "git@github.com:bnosac/drat.git")) %>% | ||
add_code_step(drat::insertPackage(pkgbuild::build("image.Otsu", binary = (getOption("pkgType") != "source")))) %>% | ||
add_code_step(drat::insertPackage(pkgbuild::build("image.CornerDetectionF9", binary = (getOption("pkgType") != "source")))) %>% | ||
#add_code_step(drat::insertPackage(pkgbuild::build("image.CornerDetectionHarris", binary = (getOption("pkgType") != "source")))) %>% | ||
add_code_step(drat::insertPackage(pkgbuild::build("image.dlib", binary = (getOption("pkgType") != "source")))) %>% | ||
#add_code_step(drat::insertPackage(pkgbuild::build("image.DenoiseNLMeans", binary = (getOption("pkgType") != "source")))) %>% | ||
#add_code_step(drat::insertPackage(pkgbuild::build("image.darknet", binary = (getOption("pkgType") != "source")))) %>% | ||
#add_code_step(drat::insertPackage(pkgbuild::build("image.CannyEdges", binary = (getOption("pkgType") != "source")))) %>% | ||
#add_code_step(drat::insertPackage(pkgbuild::build("image.OpenPano", binary = (getOption("pkgType") != "source")))) %>% | ||
add_code_step(drat::insertPackage(pkgbuild::build("image.LineSegmentDetector", binary = (getOption("pkgType") != "source")))) %>% | ||
add_code_step(drat::insertPackage(pkgbuild::build("image.ContourDetector", binary = (getOption("pkgType") != "source")))) %>% | ||
add_step(step_do_push_deploy(path = "~/git/drat")) | ||
|
||
get_stage("after_deploy") %>% | ||
add_code_step(knitr::knit("~/git/drat/index.Rmd", "~/git/drat/index.md")) %>% | ||
add_code_step(knitr::knit("~/git/drat/index.Rmd", "~/git/drat/README.md")) %>% | ||
add_step(step_do_push_deploy(path = "~/git/drat")) |