-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
79 lines (70 loc) · 3.01 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
# Use container-based Travis with caching
languague: c
sudo: false
addons:
apt:
sources:
- r-packages-trusty
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
- grep '\-g' /etc/R/Makeconf | sed 's/-g//g' > ~/.R/Makevars # Turn off debug symbols
# 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('Rcpp')) install.packages('Rcpp')"
- Rscript -e "if (!require('RcppParallel')) install.packages('RcppParallel')"
- Rscript -e "if (!require('BH')) install.packages('BH')"
- Rscript -e "if (!require('testthat')) install.packages('testthat')"
- Rscript -e "if (!require('matrixStats')) install.packages('matrixStats')"
- Rscript -e "if (!require('ggplot2')) install.packages('ggplot2')"
- Rscript -e "if (!require('graph')) { source('http://bioconductor.org/biocLite.R'); biocLite('graph') }"
- Rscript -e "if (!require('Rgraphviz')) { source('http://bioconductor.org/biocLite.R'); biocLite('Rgraphviz') }"
- Rscript -e "if (!require('MCMCpack')) install.packages('MCMCpack')"
- Rscript -e "if (!require('plotrix')) install.packages('plotrix')"
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
- _R_CHECK_CRAN_INCOMING_=FALSE R CMD check "${PKG_TARBALL}" --as-cran --no-build-vignettes
- cat ${PKG_NAME}.Rcheck/00install.out # Print out install / compile log
after_success:
# - Rscript -e 'covr::codecov()'
# Rebuild drat repo
# - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash deploy.sh
notifications:
recipients:
- msuchard@gmail.com
- lamho86@gmail.com
email:
on_success: change
on_failure: change
env:
global:
# - R_BUILD_ARGS=" "
# - R_CHECK_ARGS="--as-cran"
# secure: clBIB1ryoj28wttYw5YQClr4wTNw/s2rqs0OzjnvdnD3NAONxMz+8CXR7cmHow5nQ211J/zKP/+wnd8x0oCId2cJT2a8Kp99bjAMs6q0hvjAUBxmYQgQAJ3VQ8PNTXB4WglDimXPSJfYdExo3mqbQozWnqx9pu7Z+029/M7+h+M=