forked from gregorbj/Archive-VisionEval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (77 loc) · 4.83 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
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
language: r
sudo: true
dist: trusty
cache: packages
# Be strict when checking our package
warnings_are_errors: false
# nloptr R package requires libnlopt-dev to be installed, which requires trusty ubuntu
# phantomjs required for shinytest for VEGUI testing
before_install:
- sudo apt-get update
- sudo apt-get -y install libnlopt-dev
- "export PHANTOMJS_VERSION=2.1.1"
- "phantomjs --version"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "hash -r"
- "phantomjs --version"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then hash -r; fi"
- "phantomjs --version"
install:
- Rscript -e 'install.packages(c("curl","devtools", "roxygen2", "stringr", "knitr", "data.table", "ordinal", "geosphere", "fields", "car", "pbkrtest", "quantreg", "reshape"))'
- Rscript -e 'devtools::install_bioc(c("BiocInstaller", "rhdf5"))'
# Packages required for VEGUI
- Rscript -e 'install.packages(c("shiny", "shinyjs", "shinyFiles", "data.table", "DT", "shinyBS", "future", "testit", "jsonlite", "shinyAce", "envDocument", "rhandsontable", "shinyTree"))'
- Rscript -e 'devtools::install_github(c("tdhock/namedCapture", "rstudio/webdriver", "rstudio/shinytest"))'
# setup a different environment variable for each Travis build environment (in the matrix) to run in parallel
env:
- FOLDER=sources/framework/visioneval SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VE2001NHTS SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VECommercialTravel SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS
- FOLDER=sources/modules/VEEnergyAndEmissions SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS
- FOLDER=sources/modules/VEHouseholdTravel SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS
- FOLDER=sources/modules/VEHouseholdVehicles SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS
- FOLDER=sources/modules/VELandUse SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS,VESimHouseholds
- FOLDER=sources/modules/VESimHouseholds SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VESyntheticFirms SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VETransportSupply SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VETransportSupplyUse SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/modules/VETravelCost SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/models/VERPAT SCRIPT=run_model.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VESyntheticFirms,VELandUse,VETransportSupply,VEHouseholdVehicles,VEHouseholdTravel,VETransportSupplyUse
- FOLDER=sources/models/VERSPM/Test1 SCRIPT=run_model.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VELandUse,VETransportSupply,VEHouseholdVehicles,VEHouseholdTravel,VECommercialTravel,VEEnergyAndEmissions
- FOLDER=sources/VEGUI SCRIPT=run_vegui_test.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VESyntheticFirms,VELandUse,VETransportSupply,VEHouseholdVehicles,VEHouseholdTravel,VETransportSupplyUse
# install and test framework, modules, models, GUI
script:
- |
#install framework
cd sources/framework/visioneval
Rscript -e 'devtools::install_deps(".")'
R CMD INSTALL .
cd ../../..
#install dependent packages
IFS=',' read -r -a packages <<< $DEPENDS
for element in ${packages[@]}
do
if ( [ $element != "." ] ); then
cd sources/modules/$element
Rscript -e 'devtools::install_deps(".")'
R CMD INSTALL .
cd ../../..
fi
done
#run module or model tests
cd $FOLDER
if ( [ $TYPE == "module" ] ); then
Rscript -e 'devtools::install_deps(".")'
Rscript -e 'devtools::check(".")'
Rscript -e "tryCatch( source( '$SCRIPT' ) )"
R CMD INSTALL .
exit_status=$?
else
Rscript -e "tryCatch( source( '$SCRIPT' ) )"
exit_status=$?
fi
exit $exit_status