forked from ANTsX/ANTsR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
151 lines (134 loc) · 5.9 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
139
140
141
142
143
144
145
146
147
148
149
150
151
# use containers
sudo: false
os:
- linux
- osx
osx_image: xcode8.2
language: r
r:
- release
# - devel # stringi dependency makes this fail
matrix:
allow_failures:
- os: osx
# - r: devel
cran: http://cran.rstudio.com
r_packages:
- covr
- wesanderson
- magrittr
- mFilter
- igraph
- magic
- randomForest
r_binary_packages:
- magrittr
- devtools
- testthat
- ggplot2
- Rcpp
- dplyr
- knitr
- rmarkdown
- randomForest
- dplyr
- psych
- pracma
# cache local R libraries directory:
cache: packages
before_install:
- basedir=${PWD}
- cd ..
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cmake --version; wget --no-check-certificate https://cmake.org/files/v3.4/cmake-3.4.0-rc1-Linux-x86_64.sh; sh cmake-3.4.0-rc1-Linux-x86_64.sh --skip-license --prefix=${HOME}; export PATH=$HOME/bin/:$PATH; fi
- export PATH=$HOME/bin/:$PATH
- cd $basedir
install:
- mkdir -p ~/.R
- export CC=clang
- export CXX=clang++
- echo "CC=clang" > ~/.R/Makevars
- echo "CXX=clang++" >> ~/.R/Makevars
- echo "CXX1X=clang++" >> ~/.R/Makevars
- echo "CXX1XSTD=-std=c++11" >> ~/.R/Makevars
- source ~/.R/Makevars
- echo 'options(repos = "http://cran.rstudio.com")' > .Rprofile
- echo '.travis.yml' > .Rbuildignore
# - Rscript -e 'if(!"devtools" %in% rownames(installed.packages())) { install.packages("devtools") }'
# - Rscript -e 'if(!"stringi" %in% rownames(installed.packages())) { devtools::install_github("gagolews/stringi", dependencies = TRUE) }'
- Rscript -e 'install.packages("Rcpp", dependencies = TRUE)'
- Rscript -e 'if(!"magrittr" %in% rownames(installed.packages())) { install.packages("magrittr", dependencies = TRUE) }'
- Rscript -e 'if(!"tools" %in% rownames(installed.packages())) { install.packages("tools", dependencies = TRUE) }'
- Rscript -e 'if(!"knitr" %in% rownames(installed.packages())) { install.packages("knitr", dependencies = TRUE) }'
# - Rscript -e 'if(!"ggplot2" %in% rownames(installed.packages())) { install.packages("ggplot2", dependencies = TRUE) }'
- Rscript -e 'if(!"igraph" %in% rownames(installed.packages())) { install.packages("igraph", dependencies = TRUE) }'
- Rscript -e 'if(!"pracma" %in% rownames(installed.packages())) { install.packages("pracma", dependencies = TRUE) }'
- Rscript -e 'if(!"dplyr" %in% rownames(installed.packages())) { install.packages("dplyr", dependencies = TRUE) }'
- Rscript -e 'if(!"mFilter" %in% rownames(installed.packages())) { install.packages("mFilter", dependencies = TRUE) }'
- Rscript -e 'if(!"rmarkdown" %in% rownames(installed.packages())) { install.packages("rmarkdown", dependencies = TRUE) }'
- Rscript -e 'if(!"testthat" %in% rownames(installed.packages())) { install.packages("testthat", dependencies = TRUE) }'
- Rscript -e 'if(!"randomForest" %in% rownames(installed.packages())) { install.packages("randomForest", dependencies = TRUE) }'
- Rscript -e 'if(!"psych" %in% rownames(installed.packages())) { install.packages("psych", dependencies = TRUE) }'
# - Rscript -e 'if(!"plyr" %in% rownames(installed.packages())) { install.packages("plyr", dependencies = TRUE) }'
# - Rscript -e 'if(!"magic" %in% rownames(installed.packages())) { install.packages("magic", dependencies = TRUE) }'
- Rscript -e 'if(!"covr" %in% rownames(installed.packages())) { install.packages("covr", dependencies = TRUE) }'
# - Rscript -e 'update.packages( ask = FALSE )'
- cd ~/
- itkrrel=0.0.1
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://github.com/stnava/ITKR/releases/download/latest/ITKR_${itkrrel}_R_x86_64-pc-linux-gnu.tar.gz; R CMD INSTALL ITKR_${itkrrel}_R_x86_64-pc-linux-gnu.tar.gz; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget http://github.com/stnava/ITKR/releases/download/latest/ITKR_${itkrrel}.tgz; R CMD INSTALL ITKR_${itkrrel}.tgz; fi
- ANTsRCorerel=0.0.0
- reldir=untagged-a878f5e1fd9cffd7bb04
- reldir=latest
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://github.com/stnava/ANTsRCore/releases/download/${reldir}/ANTsRCore_${ANTsRCorerel}_R_x86_64-pc-linux-gnu.tar.gz; R CMD INSTALL ANTsRCore_${ANTsRCorerel}_R_x86_64-pc-linux-gnu.tar.gz; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget http://github.com/stnava/ANTsRCore/releases/download/${reldir}/ANTsRCore_${ANTsRCorerel}.tgz; R CMD INSTALL ANTsRCore_${ANTsRCorerel}.tgz; fi
- cd ${basedir}
# Build and check package
script:
- source ~/.R/Makevars
- export CXX=clang++
- export CC=clang
- cd ..
- travis_wait 100 R CMD build ANTsR --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- if [[ ${#TRAVIS_TAG} -eq 0 ]]; then travis_wait 100 R CMD check "${PKG_FILE_NAME}" --no-manual; fi # --as-cran
- mydir=${PWD}
- if [[ ${#TRAVIS_TAG} -gt 0 ]]; then travis_wait 100 R CMD INSTALL --build ANTsR; PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1); if [ "$TRAVIS_OS_NAME" == "osx" ]; then PKG_FILE_NAME=$(ls -1t *.tgz | head -n 1); fi; fi
# report coverage rate to coveralls
after_success:
- cd $mydir
# - cd ANTsR
# - travis_wait 100 Rscript -e 'covr::coveralls( type = "examples" )'
# takes too long, should add to matrix
after_failure:
- cat ~/build/stnava/ANTsR.Rcheck/00install.out
- cat ~/build/stnava/ANTsR.Rcheck/00check.log
# send e-mails if stuff changes
notifications:
email:
recipients:
on_success: change
on_failure: always
env:
global:
- R_BUILD_ARGS=" "
- R_CHECK_ARGS=" --timings"
- R_CHECK_TIME="TRUE"
- R_CHECK_TESTS="TRUE"
- _R_CHECK_TIMINGS_="0"
- _R_CHECK_FORCE_SUGGESTS_="0"
- BOOTSTRAP_LATEX=1
- WARNINGS_ARE_ERRORS=0
deploy:
provider: releases
api_key:
secure: VevZHK5WDwd2mFSrF3+b2jTRzImb6juOgewcOvZ8LJ2S70khn64Kx4+JGUvk5miKWVbKnHIhPxOJY50muO9sT15ApP+HFZYpiVpx4l/hEypk9zmJD+f+ERuN7j8elCzUZqet3v77XD+pBcYMxFARew4gGDkG2LO5casij0YNiyQ=
file: ${PKG_FILE_NAME}
skip_cleanup: true
overwrite: true
on:
repo: stnava/ANTsR
tags: true
all_branches: true