-
Notifications
You must be signed in to change notification settings - Fork 40
/
.travis.yml
62 lines (52 loc) · 2.09 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
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
- echo 'options(download.file.method = "wget")' >> .Rprofile
- mkdir -p ~/.R
- Rscript -e 'if (!require("devtools")) install.packages("devtools")'
- Rscript -e 'if (!require("drat")) install.packages("drat")'
- echo 'drat::addRepo("OHDSI")' >> .Rprofile
- echo 'drat::addRepo(c("OHDSI","cloudyr"))' >> .Rprofile
- Rscript -e 'if (!require("PatientLevelPrediction")) install.packages("PatientLevelPrediction", dependencies = TRUE)'
- Rscript -e 'if (!require("CohortMethod")) install.packages("CohortMethod", dependencies = TRUE)'
- Rscript -e 'if (!require("OhdsiSharing")) install.packages("OhdsiSharing", dependencies = TRUE)'
- Rscript -e 'if (!require("mailR")) install.packages("mailR", dependencies = TRUE)'
- Rscript -e 'if (!require("ReporteRs")) install.packages("ReporteRs", dependencies = TRUE)'
- Rscript -e 'update.packages(ask = FALSE, instlib = "~/Rlib")'
before_script:
- export PKG_NAME_NS=$(Rscript -e 'cat(paste0(devtools::as.package("./NoacStudy")$package))')
- export PKG_TARBALL_NS=$(Rscript -e 'pkg <- devtools::as.package("./NoacStudy"); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
# Build and check NoacStudy package
script:
- R CMD build NoacStudy --no-build-vignettes --no-manual
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL_NS}" --no-build-vignettes --no-manual
- cat ${PKG_NAME_NS}.Rcheck/00install.out # Print out install / compile log
notifications:
recipients:
email:
on_success: change
on_failure: change
after_success:
# Deploy to drat repo
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh