-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
96 lines (78 loc) · 3.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
# using suggestions from:
# github.com/jtilly/R-travis-container-example/blob/master/.travis.yml
# kieranhealy.org/blog/archives/2015/10/16/using-containerized-travis-ci-to-check-r-in-rmarkdown-files/
# gist.github.com/willprice/e07efd73fb7f13f917ea
language: r
#r:
# - release
# - devel
cache:
directories:
- ${HOME}/R-bin/lib/R/library
- ${HOME}/R/Library
# use containers (so no sudo)
sudo: false
# trigger on pushes to master branch
branches:
only:
- master
# really would prefer r lang pre-installed with all packages here
# install R: use r-packages-precise (https://cran.r-project.org/bin/linux/ubuntu/precise/)
# as source which is white listed (https://github.com/travis-ci/apt-source-whitelist/)
#addons:
# apt:
# sources:
# - r-packages-precise
# packages:
# - r-base-dev
# - r-recommended
# - install package with dependencies
install:
- echo R_LIBS is ${R_LIBS} # empty and not set in R startup
- echo R_LIBS_SITE is ${R_LIBS_SITE}#/usr/local/lib/R/site-library:/usr/lib/R/site-library
- echo R_LIB_USER is ${R_LIB_USER} # empty but set to /home/travis/R/Library in R startup
- echo R_HOME is ${R_HOME}
- which R #/home/travis/R-bin/bin/R
- echo 'options(repos = "http://cran.r-project.org")' > .Rprofile
- Rscript -e 'update.packages( ask=FALSE)'
- Rscript -e 'library() ; .libPaths() '
- Rscript -e 'Sys.getenv(c("R_HOME","R_LIBS" ,"R_LIBS_USER","R_LIBS_SITE"))'
# - ls ${HOME}/R/Library
# - ls ${HOME}/R-bin/
# - ls ${HOME}/R-bin/library
# - ls ${HOME}/R-bin/site-library
# - ls ${HOME}/R-bin/lib
# run checks
script:
- OS_TAG=`uname -i`_`uname -o`
- OS_TAG=${OS_TAG////-} # rm / from name for file
- cd ${HOME}/build/pdgilbert/
# - git clone --depth=10 --branch=${OS_TAG} https://${GITHUB_TOKEN}@github.com/pdgilbert
# only need ${OS_TAG} and master but ...
- git clone https://${GITHUB_TOKEN}@github.com/pdgilbert/2piQA.git ${OS_TAG}
- cd ${OS_TAG}
- git checkout ${OS_TAG}
- CHANGE=`git diff-tree --no-commit-id --name-only -r ${TRAVIS_COMMIT}`
- echo CHANGE would be ${CHANGE}
- CHANGE='R/PkgSnippets/dse/1stSnippetTest/fail1.R R/PkgSnippets/dse/2ndSnippetTest/SnippetDescription.txt'
- uname -rio >KERNEL_VERSION
- echo ${TRAVIS_COMMIT} >TRAVIS_COMMIT
- echo ${TRAVIS_OS_NAME} >TRAVIS_OS_NAME
- echo ${TRAVIS_R_VERSION} >TRAVIS_R_VERSION
- git config --global user.email "travis@travis-ci.org"
- git config --global user.name "Travis CI"
- git config --global push.default simple #to squelch warning message
- git add KERNEL_VERSION TRAVIS_COMMIT TRAVIS_OS_NAME TRAVIS_R_VERSION
- git commit -m "add records of system info."
# pull with rebase might be preferred here?
- git merge -s recursive -X theirs master -m "updated snippet files (from master into branch)."
# loop is for case of changes in multiple snippet dirs
- (cd R/ ; for f in $CHANGE ; do ./SnippetTestFile ${f} ; done )
after_success:
- git push # origin HEAD:${OS_TAG}
# - git push --quiet --set-upstream
# send e-mails on changes
#notifications:
# email:
# on_success: change
# on_failure: change