Skip to content

Commit d2eb3fd

Browse files
committed
Merge pull request #110 from zbeekman/issue-80-test-install-sh-expand-matrix
Expand test matrix to include install.sh script and `build` - Closes #110
2 parents 4703954 + 69a9b02 commit d2eb3fd

File tree

1 file changed

+105
-41
lines changed

1 file changed

+105
-41
lines changed

.travis.yml

Lines changed: 105 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,46 @@ env:
99
- MPICH_DIR="$HOME/.local/usr/mpich"
1010
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
1111
- MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"
12-
- OSX_PACKAGES="gcc cmake"
13-
- BUILD_TYPE="CodeCoverage"
1412

1513
matrix:
1614
include:
1715
- os: osx
16+
env:
17+
- BUILD_TYPE="CodeCoverage"
18+
OSX_PACKAGES="gcc cmake"
19+
- os: osx
20+
env:
21+
- BUILD_TYPE="Release"
22+
OSX_PACKAGES="gcc cmake"
23+
- os: osx
24+
env:
25+
- BUILD_TYPE="InstallScript"
26+
OSX_PACKAGES="gcc"
27+
- os: linux
28+
sudo: false
29+
env:
30+
- BUILD_TYPE="CodeCoverage"
31+
cache:
32+
directories:
33+
- "$CACHE"
34+
addons:
35+
apt:
36+
sources:
37+
- george-edison55-precise-backports
38+
- ubuntu-toolchain-r-test
39+
packages:
40+
- gcc-5
41+
- gfortran-5
42+
- binutils
43+
- cmake-data
44+
- cmake
1845
- os: linux
1946
sudo: false
47+
env:
48+
- BUILD_TYPE="Release"
2049
cache:
2150
directories:
2251
- "$CACHE"
23-
- "$HOME/.cache/pip"
2452
addons:
2553
apt:
2654
sources:
@@ -32,6 +60,17 @@ matrix:
3260
- binutils
3361
- cmake-data
3462
- cmake
63+
- os: linux
64+
sudo: false
65+
env:
66+
- BUILD_TYPE="InstallScript"
67+
addons:
68+
apt:
69+
sources:
70+
- ubuntu-toolchain-r-test
71+
packages:
72+
- gcc-5
73+
- gfortran-5
3574

3675
before_install:
3776
- |
@@ -45,78 +84,103 @@ before_install:
4584
export CC=gcc-5
4685
$FC --version
4786
$CC --version
48-
cmake --version
4987
fi
5088
5189
install:
5290
- |
5391
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
54-
brew update > /dev/null
92+
brew update > /dev/null
5593
5694
for pkg in $OSX_PACKAGES; do
5795
[[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
5896
brew outdated $pkg || brew upgrade --force-bottle $pkg
5997
done
6098
export FC=gfortran-5
6199
export CC=gcc-5
62-
if ! [[ "$(brew ls --versions mpich)" ]]; then
100+
if ! [[ "$(brew ls --versions mpich)" ]] && [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then
63101
wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
64102
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
65103
if ! [[ "$(brew ls --versions mpich)" ]]; then
66104
brew install --force-bottle mpich
67105
fi
106+
mpif90 --version
107+
mpicc --version
108+
cmake --version
109+
export FC=mpif90
110+
export CC=mpicc
111+
elif [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then # uninstall some stuff if present
112+
[[ "$(brew ls --versions cmake)" ]] && brew rm cmake || true
113+
[[ "$(brew ls --versions mpich)" ]] && brew rm mpich || true
114+
[[ "$(brew ls --versions openmpi)" ]] && brew rm openmpi || true
68115
fi
69-
else
116+
elif [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
70117
if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
71118
# mpich install not cached
72-
if ( [[ $TRAVIS ]] && [[ "X$TRAVIS_BRANCH" == Xbranch-1.* ]] ); then
73-
install_prerequisites/build mpich "$MPICH_VER" "$MPICH_DIR" 4
74-
else
75-
# install_prerequisites/build is broken as of 2015.12.09 / 9d2edbb0 on master
76-
# argument parsing bug fixes haven't made it back into master yet...
77-
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
78-
mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
79-
pushd "$MPICH_DIR/.."
80-
tar -xzvf "$MPICH_URL_TAIL"
81-
cd "${MPICH_URL_TAIL%.tar.gz}"
82-
./configure --prefix="$MPICH_DIR"
83-
make -j 4
84-
make install
85-
popd
119+
# could use install_prerequisites/build instead...
120+
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
121+
mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
122+
pushd "$MPICH_DIR/.."
123+
tar -xzvf "$MPICH_URL_TAIL"
124+
cd "${MPICH_URL_TAIL%.tar.gz}"
125+
./configure --prefix="$MPICH_DIR"
126+
make -j 4
127+
make install
128+
popd
129+
for f in "$MPICH_DIR/bin/"*; do
130+
if [[ -x "$f" ]]; then
131+
ln -fs "$f" "$HOME/.local/bin/${f##*/}" && "${f##*/}" --version
86132
fi
87-
for f in "$MPICH_DIR/bin/"*; do
88-
if [[ -x "$f" ]]; then
89-
ln -fs "$f" "$HOME/.local/bin/${f##*/}" && "${f##*/}" --version
90-
fi
91-
done
92-
fi
133+
done
93134
fi
94-
95-
before_script:
96-
- mpif90 --version
97-
- export FC=mpif90
98-
- mpicc --version
99-
- export CC=mpicc
100-
- cmake --version
135+
mpif90 --version
136+
mpicc --version
137+
cmake --version
138+
export FC=mpif90
139+
export CC=mpicc
140+
fi
101141
102142
script:
103-
- mkdir cmake-build
104-
- cd cmake-build
105-
- cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
106-
- make -j 4
107-
- ctest --verbose
108-
- make install
109-
- cd ..
143+
- |
144+
if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
145+
export FC=gfortran-5
146+
export CC=gcc-5
147+
[[ -d "$HOME/opt" ]] || mkdir "$HOME/opt"
148+
[[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
149+
ln -fs "$(which gfortran-5)" "$HOME/bin/gfortran"
150+
ln -fs "$(which gcc-5)" "$HOME/bin/gcc"
151+
ln -fs "$(which g++-5)" "$HOME/bin/g++"
152+
export PATH="$PATH:$HOME/bin"
153+
yes | ./install.sh $HOME/opt/opencoarrays 4 > install.log &
154+
install_sh_PID=$!
155+
echo "install.log will be displayed after success or failure"
156+
while ps -p $install_sh_PID > /dev/null; do
157+
echo "Still working on installing opencoarrays and dependencies"
158+
sleep 300 # prevent Travis-CI abort due to inactivity and excessive logging
159+
done
160+
else
161+
mkdir cmake-build
162+
cd cmake-build
163+
cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
164+
make -j 4
165+
ctest --verbose
166+
make install
167+
cd ..
168+
fi
110169
111170
after_success:
112171
- find . -name '*.gcno' -print
113172
- gcov-5 --version
114173
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)
174+
- cat install.log || true
175+
176+
after_failure:
177+
- cat install.log || true
115178

116179
notifications:
117180
webhooks:
118181
urls:
119182
- https://webhooks.gitter.im/e/93dbafbdf76c1732a623
183+
- https://webhooks.gitter.im/e/935231573bf1b9f2fe40
120184
on_success: change # options: [always|never|change]
121185
on_failure: always
122186
on_start: always

0 commit comments

Comments
 (0)