forked from OHDSI/StudyProtocols
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (58 loc) · 2.68 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
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("cloudyr")' >> .Rprofile
- Rscript -e 'if (!require("CohortMethod")) install.packages("CohortMethod", dependencies = TRUE)'
- Rscript -e 'if (!require("OhdsiSharing")) install.packages("OhdsiSharing", dependencies = TRUE)'
- Rscript -e 'if (!require("OhdsiRTools")) install.packages("OhdsiRTools", dependencies = TRUE)'
- Rscript -e 'if (!require("meta")) install.packages("meta", 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_KA=$(Rscript -e 'cat(paste0(devtools::as.package("./KeppraAngioedema")$package))')
- export PKG_TARBALL_KA=$(Rscript -e 'pkg <- devtools::as.package("./KeppraAngioedema"); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
- export PKG_NAME_AR=$(Rscript -e 'cat(paste0(devtools::as.package("./AlendronateVsRaloxifene")$package))')
- export PKG_TARBALL_AR=$(Rscript -e 'pkg <- devtools::as.package("./AlendronateVsRaloxifene"); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
# Build and check NoacStudy package
script:
- R CMD build KeppraAngioedema --no-build-vignettes --no-manual
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL_KA}" --no-build-vignettes --no-manual
- cat ${PKG_NAME_KA}.Rcheck/00install.out # Print out install / compile log
- R CMD build AlendronateVsRaloxifene --no-build-vignettes --no-manual
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL_AR}" --no-build-vignettes --no-manual
- cat ${PKG_NAME_AR}.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