forked from pyswmm/Stormwater-Management-Model
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
108 lines (95 loc) · 2.96 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
language: python
matrix:
include:
- os: linux
python: 3.6
- os: osx
osx_image: xcode10
language: generic
#compiler:
# - gcc
# - clang
# On OS X, gcc is an alias for clang s. https://docs.travis-ci.com/user/languages/c/#gcc-on-os-x
env:
global:
- SWMM_HOME=`pwd`
- BUILD_HOME=build
- RELEASE_HOME=release
- TEST_HOME=nrtestsuite
- SWMM_VERSION=""
- GIT_RELEASE_DIR=GIT_RELEASE
- NRTESTS_URL=https://github.com/OpenWaterAnalytics/%PROJECT%-nrtestsuite
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update ;
brew install libomp ;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -qq update ;
sudo apt-get install -y libboost-test-dev ;
sudo apt-get install -y swig ;
fi
#install:
before_script:
- mkdir -p $BUILD_HOME
- mkdir -p $RELEASE_HOME
script:
- cd $BUILD_HOME
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cmake ../ -DBUILD_TESTS=ON -DBUILD_COVERAGE=ON .. ;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cmake ../ -DBUILD_TESTS=ON .. ;
fi
- cmake --build .
# run unit tests
- cd tests
- ctest
- cd $SWMM_HOME
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
pip install --src build/packages -r tools/requirements.txt ;
tools/before-test.sh $TEST_HOME $SWMM_HOME/$BUILD_HOME/bin $TRAVIS_COMMIT ;
tools/run-nrtest.sh -c -t $TEST_HOME -v $TRAVIS_COMMIT ;
fi
- cd $SWMM_HOME
deploy:
provider: releases
api_key: $OWA_SWMM_CI_TOKEN
file:
- "$SWMM_HOME/OWA-SWMM-$TRAVIS_OS_NAME-$SWMM_VERSION.zip"
skip_cleanup: true
overwrite: true
draft: true
on:
branch: develop
tag: true
after_success:
- cd $SWMM_HOME
- cd $RELEASE_HOME
- cmake ../
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cmake ../ -DBUILD_TESTS=OFF -DBUILD_COVERAGE=OFF .. ;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cmake ../ -DBUILD_TESTS=OFF .. ;
fi
- cmake --build . --config Release
- ls -l $SWMM_HOME/$RELEASE_HOME/
- cd $SWMM_HOME
- SWMM_VERSION=$($SWMM_HOME/$RELEASE_HOME/bin/run-swmm --version 2>&1)
- SWMM_VERSION="$(echo -e "${SWMM_VERSION}" | sed -n -e 'H;${x;s/\n//g;p;}')"
- echo $SWMM_VERSION
- mkdir $GIT_RELEASE_DIR
- mkdir $GIT_RELEASE_DIR/$TRAVIS_OS_NAME
- mkdir $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"lib"
- mkdir $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"bin"
- mkdir $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"include"
- cp $SWMM_HOME/$RELEASE_HOME/lib/* $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"lib"
- cp $SWMM_HOME/$RELEASE_HOME/bin/run-swmm $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"bin"
- cp $SWMM_HOME/include/* $GIT_RELEASE_DIR/$TRAVIS_OS_NAME/"include"
- echo "OWA-SWMM-$TRAVIS_OS_NAME-$SWMM_VERSION.zip"
- cd $GIT_RELEASE_DIR/$TRAVIS_OS_NAME
- zip -r "../../OWA-SWMM-$TRAVIS_OS_NAME-$SWMM_VERSION.zip" ./lib/ ./bin/ ./include/
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
bash <(curl -s https://codecov.io/bash) ;
fi