forked from gregorbj/Archive-VisionEval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
87 lines (79 loc) · 5.53 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
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
language: r
r: 3.4
sudo: true
dist: trusty
cache: packages
git:
depth: 10
# 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("3.6/BiocInstaller", "3.6/rhdf5"))'
# Packages required for VEGUI
- Rscript -e 'install.packages(c("shiny", "shinyjs", "shinyFiles", "DT", "shinyBS", "future", "testit", "jsonlite", "shinyAce", "envDocument", "rhandsontable", "shinyTree",
"shinytest", "webdriver"))'
- Rscript -e 'devtools::install_github(c("tdhock/namedCapture"))'
# 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/VEHouseholdTravel SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS
- FOLDER=sources/modules/VEHouseholdVehicles SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS,VEHouseholdTravel
- FOLDER=sources/modules/VELandUse SCRIPT=tests/scripts/verspm_test.R TYPE=module DEPENDS=VE2001NHTS,VESimHouseholds
- FOLDER=sources/modules/VESimHouseholds SCRIPT=tests/scripts/verspm_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/VETravelPerformance SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS,VEHouseholdTravel,VEPowertrainsAndFuels
- FOLDER=sources/modules/VEPowertrainsAndFuels SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS,VEHouseholdTravel
- FOLDER=sources/modules/VEReports SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=VE2001NHTS,VEHouseholdTravel
# - FOLDER=sources/modules/VEScenario SCRIPT=tests/scripts/test.R TYPE=module DEPENDS=
- FOLDER=sources/models/BaseYearVERPAT SCRIPT=run_model.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VESyntheticFirms,VELandUse,VETransportSupply,VEHouseholdTravel,VEHouseholdVehicles,VETransportSupplyUse,VEReports
- FOLDER=sources/models/VERPAT SCRIPT=run_model.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VESyntheticFirms,VELandUse,VETransportSupply,VEHouseholdTravel,VEHouseholdVehicles,VETransportSupplyUse,VEReports
- FOLDER=sources/models/VERSPM/Test1 SCRIPT=run_model.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VELandUse,VETransportSupply,VEHouseholdTravel,VEHouseholdVehicles,VEPowertrainsAndFuels,VETravelPerformance
- FOLDER=sources/VEGUI SCRIPT=run_vegui_test.R TYPE=model DEPENDS=VE2001NHTS,VESimHouseholds,VESyntheticFirms,VELandUse,VETransportSupply,VEHouseholdTravel,VEHouseholdVehicles,VETransportSupplyUse,VEReports
# 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(".")'
Rscript -e 'devtools::document()'
R CMD INSTALL .
cd ../../..
fi
done
# run module or model tests
# - |
# cd $FOLDER
# if ( [ $TYPE == "module" ] ); then Rscript -e 'devtools::install_deps(".")'; fi
# - if ( [ $TYPE == "module" ] ); then Rscript -e 'devtools::check(".")'; fi
# - if ( [ $TYPE == "module" ] ); then Rscript -e "tryCatch( source( '$SCRIPT' ) )"; fi
# - if ( [ $TYPE == "module" ] ); then R CMD INSTALL .; fi
# - if ( [ $TYPE == "model" ] ); then Rscript -e "tryCatch( source( '$SCRIPT' ) )"; fi