forked from OHDSI/CohortMethod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (73 loc) · 4.15 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
language: c
# use containers
sudo: false
addons:
apt:
sources:
- r-packages-precise
packages:
- r-base-dev
- r-recommended
- pandoc
- default-jdk
- default-jre
# cache local R libraries directory:
cache:
directories:
- ~/Rlib
# install the package and dependencies:
install:
- mkdir -p ~/Rlib
- echo 'R_LIBS=~/Rlib' > .Renviron
- echo 'options(repos = "http://cran.rstudio.com")' > .Rprofile
- mkdir -p ~/.R
- Rscript -e 'if(!"devtools" %in% rownames(installed.packages())) { install.packages("devtools", dependencies = TRUE) }'
- Rscript -e 'if (!require("covr")) devtools::install_github("jimhester/covr")'
- Rscript -e 'if (!require("drat")) install.packages("drat")'
- Rscript -e 'if(!"rJava" %in% rownames(installed.packages())) { install.packages("rJava", dependencies = TRUE) }'
- Rscript -e 'if(!"testthat" %in% rownames(installed.packages())) { install.packages("testthat", dependencies = TRUE) }'
- Rscript -e 'if(!"pROC" %in% rownames(installed.packages())) { install.packages("pROC", dependencies = TRUE) }'
- Rscript -e 'if(!"gnm" %in% rownames(installed.packages())) { install.packages("gnm", dependencies = TRUE) }'
- Rscript -e 'if(!"knitr" %in% rownames(installed.packages())) { install.packages("knitr", dependencies = TRUE) }'
- Rscript -e 'if(!"rmarkdown" %in% rownames(installed.packages())) { install.packages("rmarkdown", dependencies = TRUE) }'
- Rscript -e 'if(!"EmpiricalCalibration" %in% rownames(installed.packages())) { install.packages("EmpiricalCalibration", dependencies = TRUE) }'
- Rscript -e 'if(!"ggplot2" %in% rownames(installed.packages())) { install.packages("ggplot2", dependencies = TRUE) }'
- Rscript -e 'if(!"bit" %in% rownames(installed.packages())) { install.packages("bit", dependencies = TRUE) }'
- Rscript -e 'if(!"ff" %in% rownames(installed.packages())) { install.packages("ff", dependencies = TRUE) }'
- Rscript -e 'if(!"ffbase" %in% rownames(installed.packages())) { install.packages("ffbase", dependencies = TRUE) }'
- Rscript -e 'if(!"plyr" %in% rownames(installed.packages())) { install.packages("plyr", dependencies = TRUE) }'
- Rscript -e 'if(!"survAUC" %in% rownames(installed.packages())) { install.packages("survAUC", dependencies = TRUE) }'
- Rscript -e 'if(!"RJDBC" %in% rownames(installed.packages())) { install.packages("RJDBC", dependencies = TRUE) }'
- Rscript -e 'if(!"survival" %in% rownames(installed.packages())) { install.packages("survival", dependencies = TRUE) }'
- Rscript -e 'if(!"Cyclops" %in% rownames(installed.packages())) { install.packages("Cyclops", dependencies = TRUE) }'
# Install OHDSI dependencies
- Rscript -e 'devtools::install_github("OHDSI/OhdsiRTools")'
- Rscript -e 'devtools::install_github("OHDSI/SqlRender")'
- Rscript -e 'devtools::install_github("OHDSI/DatabaseConnector")'
- Rscript -e 'devtools::install_github("OHDSI/FeatureExtraction")'
- Rscript -e 'update.packages(ask = FALSE, instlib = "~/Rlib")'
- Rscript -e 'devtools::install_deps(pkg = ".", dependencies = TRUE)'
before_script:
- export PKG_NAME=$(Rscript -e 'cat(paste0(devtools::as.package(".")$package))')
- export PKG_TARBALL=$(Rscript -e 'pkg <- devtools::as.package("."); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
# Build and check package
script:
- R CMD build . --no-build-vignettes --no-manual
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL}" --no-build-vignettes --no-manual
- cat ${PKG_NAME}.Rcheck/00install.out # Print out install / compile log
notifications:
recipients:
email:
on_success: change
on_failure: change
after_success:
- Rscript -e 'library(covr);codecov()'
# Rebuild docker container
- curl --data "build=true" -X POST https://registry.hub.docker.com/u/ohdsi/broadsea-methodslibrary/trigger/f0b51cec-4027-4781-9383-4b38b42dd4f5/
# Deploy to drat repo
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh
env:
global:
- secure: PiXvBNIYwsoV6XRx9MLNu2MOI6sgk/xgJO/T4FCCRC+0zBuNUUkvDN2mEKO8y2p+CgwXDq/JVq9gJb6NvwBf2lj7PDQwEuxU3j0Tinx56IdIrWbia98QW91b8F8+dg8M3FEt0BEPlbiDKqSjhqcv3fXOOoxT9QbQjaZaA1zkCAk=