forked from jmsgrogan/MicrovesselChaste
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
86 lines (82 loc) · 3.69 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
# Enable C++ support
language: cpp
sudo: required
dist: trusty
compiler:
- gcc
cache:
timeout: 1000
directories:
- ../chaste-build # the build directory
- ../chaste-source # the Chaste source directory
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
- cmake
before_install:
- wget https://www.dropbox.com/s/p05hu95q30rsllt/castxml-linux.tar.gz && tar -C "${TRAVIS_BUILD_DIR}"/../ -zxvf castxml-linux.tar.gz
install:
- sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 422C4D99
- echo "deb http://www.cs.ox.ac.uk/chaste/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install libpq-dev libboost-all-dev python-numpy -y
- sudo cp /usr/lib/x86_64-linux-gnu/libpq.so /usr/lib/
- sudo apt-get install chaste-source -y
- export PETSC_DIR=/usr/lib/petscdir/3.4.2/
- export PETSC_ARCH=linux-gnu-c-opt
# Build steps
before_script:
- sudo ln -s /usr/bin/gcc-6 /usr/local/bin/gcc
- sudo ln -s /usr/bin/g++-6 /usr/local/bin/g++
- wget https://bitbucket.org/petsc/petsc/get/v3.4.2.tar.gz && tar -zxf v3.4.2.tar.gz
- sudo mkdir -p $PETSC_DIR/$PETSC_ARCH/include/petsc/private/
- sudo cp petsc-petsc-a071802d3efe/include/petsc-private/vecimpl.h $PETSC_DIR/$PETSC_ARCH/include/petsc/private/vecimpl.h
- sudo cp petsc-petsc-a071802d3efe/include/petsc-private/matimpl.h $PETSC_DIR/$PETSC_ARCH/include/petsc/private/matimpl.h
- gcc -v && g++ -v && cmake --version
- sudo pip install numpy matplotlib
- wget https://bitbucket.org/petsc/petsc4py/downloads/petsc4py-3.4.tar.gz && tar -zxf petsc4py-3.4.tar.gz
- cd petsc4py-3.4 && python setup.py build && sudo python setup.py install && cd ..
- "export DISPLAY=:99.0" # For GUI tests
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
- |
if [ -d "${TRAVIS_BUILD_DIR}"/../chaste-source/projects/ ]; then
cd "${TRAVIS_BUILD_DIR}"/../chaste-source && git pull && cd ..
else
cd "${TRAVIS_BUILD_DIR}"/../ && git clone --depth=2 -b develop https://chaste.cs.ox.ac.uk/git/chaste.git chaste-source
fi
script:
- |
if [ ! -d "${TRAVIS_BUILD_DIR}"/../chaste-source/projects/MicrovesselChaste/ ]; then
ln -s "${TRAVIS_BUILD_DIR}" "${TRAVIS_BUILD_DIR}"/../chaste-source/projects/
fi
- mkdir -p "${TRAVIS_BUILD_DIR}"/../chaste-build && cd "${TRAVIS_BUILD_DIR}"/../chaste-build
- |
if [[ -f touch_order.txt ]]; then
while read fn; do
touch $fn
done < touch_order.txt
# touch changed git files to trigger their rebuild
read PREVIOUS_GIT_COMMIT < previous_git_commit.txt
cd "${TRAVIS_BUILD_DIR}"
changed_files=`git diff --name-only $PREVIOUS_GIT_COMMIT HEAD`
echo "Previously cached Travis build based on git commit ${PREVIOUS_GIT_COMMIT}."
echo "... changed files since then:"
echo $changed_files
touch `echo $changed_files`
cd "${TRAVIS_BUILD_DIR}"/../chaste-build
else
cmake "${TRAVIS_BUILD_DIR}"/../chaste-source -DCASTXML_EXE_LOC="${TRAVIS_BUILD_DIR}"/../castxml/bin/castxml
fi
cmake . && make project_MicrovesselChaste -j 2
# # following: https://github.com/NLeSC/root-roofit-dev/blob/travis_make-optimize_deps/.travis.yml
# Save the order of timestamps of the files so we can recreate it with touch in the next build.
# N.B.: just tarring the build files doesn't work, since the git clone will still be newer.
# The build tools (make at least) only care about order, not about absolute timestamps.
before_cache:
- find . -type f -printf "%T+\t%p\n" | sort | cut -f 2 > touch_order.txt
- cd "${TRAVIS_BUILD_DIR}" && git rev-parse HEAD > "${TRAVIS_BUILD_DIR}"/../chaste-build/previous_git_commit.txt