forked from OHDSI/Cyclops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
138 lines (129 loc) · 5.07 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#language: cpp
#compiler:
#- gcc
#sudo: required
#before_install:
#- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
#- chmod 755 ./travis-tool.sh
#- ./travis-tool.sh bootstrap
#- sudo sed 's/-g//g' /etc/R/Makeconf > tmp
#- sudo mv tmp /etc/R/Makeconf
#- ./travis-tool.sh install_devtools
#- ./travis-tool.sh install_deps
#- ./travis-tool.sh install_r ggplot2 ff ffbase
#- ./travis-tool.sh install_github jimhester/covr
#- ./travis-tool.sh install_github eddelbuettel/drat
#before_script:
#- sudo apt-get install libboost-dev
#- 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"))')
#script:
#- ./travis-tool.sh run_tests
#- ls -l Cyclops.Rcheck/Cyclops/libs
#after_failure:
#- ./travis-tool.sh dump_logs
#notifications:
# recipients:
# email:
# on_success: change
# on_failure: always
#after_success:
#- Rscript -e 'library(covr);codecov()'
#- curl --data "build=true" -X POST https://registry.hub.docker.com/u/ohdsi/development/trigger/e51f720d-c4e7-45df-b042-5d8a362bd7e0/
#- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash
# deploy.sh
# - grep '\-g' /etc/R/Makeconf | sed 's/-g//g' > ~/.R/Makevars # Turn off debug symbols
languague: c
sudo: false
matrix:
include:
# gcc default
- compiler: gcc
addons:
apt:
sources:
- r-packages-precise
packages:
- r-base-dev
- r-recommended
- texinfo
- qpdf
# gcc 6
- compiler: gcc
addons:
apt:
sources:
- r-packages-precise
- ubuntu-toolchain-r-test
packages:
- r-base-dev
- r-recommended
- texinfo
- qpdf
- g++-6
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"))')
- echo 'CC=gcc-6' > ~/.R/Makevars
- echo 'CXX=g++-6' >> ~/.R/Makevars
- echo 'CXX1X=g++-6' >> ~/.R/Makevars
- echo 'PKG_CXXFLAGS= -std=c++14 -s -g1 -Wno-ignored-attributes -Wno-deprecated-declarations' >> ~/.R/Makevars
#addons:
# apt:
# sources:
# - r-packages-precise
# packages:
# - r-base-dev
# - r-recommended
# - texinfo
# - qpdf
cache:
directories:
- ~/Rlib # R libraries
- ~/texlive # LaTex
- ~/bin # pandoc
# install dependencies
install:
# Save R packages in Rlib
- mkdir -p ~/Rlib
- echo 'R_LIBS=~/Rlib' > .Renviron
- echo 'options(repos = "http://cran.rstudio.com")' > .Rprofile
- mkdir -p ~/.R
# Build LaTex and pandoc
- mkdir -p ~/bin
- wget -q -O - https://github.com/yihui/crandalf/raw/master/inst/scripts/install-texlive | bash
- wget -q -O - https://github.com/yihui/crandalf/raw/master/inst/scripts/install-pandoc | bash
- PATH=$HOME/texlive/bin/x86_64-linux:$PATH
# Install R packages
- Rscript -e "if (!require('devtools')) install.packages('devtools')"
- Rscript -e "if (!require('covr')) devtools::install_github('jimhester/covr')"
- Rscript -e "if (!require('rmarkdown')) install.packages('rmarkdown')"
- Rscript -e "if (!require('knitr')) install.packages('knitr')"
- Rscript -e "if (!require('drat')) install.packages('drat')"
- Rscript -e "if (!require('ff')) install.packages('ff')"
- Rscript -e "if (!require('ffbase')) install.packages('ffbase')"
- Rscript -e "if (!require('ggplot2')) install.packages('ggplot2')"
- Rscript -e "if (!require('RcppParallel')) install.packages('RcppParallel')"
- Rscript -e "if (!require('BH')) install.packages('BH')"
- Rscript -e "if (!require('RcppEigen')) install.packages('RcppEigen')"
- Rscript -e "if (!require('testthat')) install.packages('testthat')"
- Rscript -e "if (!require('gnm')) install.packages('gnm')"
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 .
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL}" --as-cran
- cat ${PKG_NAME}.Rcheck/00install.out # Print out install / compile log
after_success:
- Rscript -e '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/
# Rebuild drat repo
- export PKG_TARBALL=$(Rscript -e 'pkg <- devtools::as.package("."); cat(paste0(pkg$package,"_",pkg$version,".tar.gz"))')
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh
env:
global:
- secure: OqWkvryQHJ8TCDu++1fjNNfd+ECuPH+og++cXgfpQ3QcTjReD0cc3dGP+tD3GX18H9jJa+MQzNXyBCHn8+o1b1MRiUGAKuxD0vsZ2iQ/1nZYiL2cKJbei36vJPVg82D68zOsE/G5rESKFOQKUC+OqNHcneyk1+cwsU7zvQTtBhU=