forked from sourceryinstitute/OpenCoarrays
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
246 lines (234 loc) · 8.87 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
language: generic
env:
global:
- CACHE="$HOME/.local"
- MPICH_VER="3.2"
- MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
- MPICH_DIR="$HOME/.local/usr/mpich"
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/452136/"
- MPICH_BOT_URL_TAIL="mpich-3.2_2.yosemite.bottle.1.tar.gz"
- FC=gfortran-6
- CC=gcc-6
- CXX=g++-6
matrix:
include:
- os: osx
env:
- BUILD_TYPE="CodeCoverage"
OSX_PACKAGES="gcc cmake"
- os: osx
env:
- BUILD_TYPE="Release"
OSX_PACKAGES="gcc cmake"
- os: osx
env:
- BUILD_TYPE="InstallScript"
OSX_PACKAGES="gcc"
- &ubuntu
os: linux
sudo: false
env:
- BUILD_TYPE="CodeCoverage"
cache:
apt: false
directories:
- "$CACHE"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
packages:
- gcc-6
- gfortran-6
- g++-6
- binutils
- cmake-data
- cmake
-
<<: *ubuntu
env:
- BUILD_TYPE="Release"
-
<<: *ubuntu
env:
- BUILD_TYPE="InstallScript"
cache: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- gfortran-6
- g++-6
before_install:
- |
set -o errexit
if [[ "$TRAVIS_TAG" ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]] && $TRAVIS_SECURE_ENV_VARS ; then
brew update > /dev/null
[[ "$(brew ls --versions gpg2)" ]] || brew install gpg2
brew outdated gpg2 || brew upgrade gpg2
which openssl || brew install openssl
fi
if ! [[ "$TRAVIS_TAG" ]] || ! $TRAVIS_SECURE_ENV_VARS ; then
unset encrypted_ef4535c39461_key || true
unset encrypted_ef4535c39461_iv || true
rm subkey-328B3A0E-secret.asc{,.enc} || true
fi
if [[ "$TRAVIS_TAG" ]] ; then
curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import
git tag -v ${TRAVIS_TAG}
fi
set +o errexit
-
-
-
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
export PATH="$PATH:$HOME/Library/Python/2.7/bin"
else
[[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
[[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
export PATH="$CACHE/bin:$PATH"
$FC --version
$CC --version
$CXX --version
fi
set +o errexit
install:
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
brew update > /dev/null
for pkg in $OSX_PACKAGES; do
[[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
brew outdated $pkg || brew upgrade --force-bottle $pkg
done
if ! [[ "$(brew ls --versions mpich)" ]] && [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then
wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
if ! [[ "$(brew ls --versions mpich)" ]]; then
brew install --force-bottle mpich
fi
mpif90 --version
mpicc --version
cmake --version
elif [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then # uninstall some stuff if present
[[ "$(brew ls --versions cmake)" ]] && brew rm cmake || true
[[ "$(brew ls --versions mpich)" ]] && brew rm mpich || true
[[ "$(brew ls --versions openmpi)" ]] && brew rm openmpi || true
fi
elif [[ "X$BUILD_TYPE" != "XInstallScript" ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
# mpich install not cached
# could use prerequisites/build instead...
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
mv "$MPICH_URL_TAIL" "$MPICH_DIR/.."
pushd "$MPICH_DIR/.."
tar -xzvf "$MPICH_URL_TAIL"
cd "${MPICH_URL_TAIL%.tar.gz}"
./configure --prefix="$MPICH_DIR"
make -j 4
make install
popd
for f in "$MPICH_DIR/bin/"*; do
if [[ -x "$f" ]]; then
ln -fs "$f" "$HOME/.local/bin/${f##*/}"
fi
done
fi
mpif90 --version
mpicc --version
cmake --version
fi
set +o errexit
script:
- |
set -o errexit
if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
[[ -d "$HOME/opt" ]] || mkdir "$HOME/opt"
[[ -d "$HOME/bin" ]] || mkdir "$HOME/bin"
ln -fs "$(which gfortran-6)" "$HOME/bin/gfortran"
ln -fs "$(which gcc-6)" "$HOME/bin/gcc"
ln -fs "$(which g++-6)" "$HOME/bin/g++"
export PATH="$PATH:$HOME/bin"
./install.sh --yes-to-all -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++"
cd prerequisites/builds/opencoarrays/*
../../../installations/cmake/*/bin/ctest --output-on-failure --schedule-random --repeat-until-fail 7
cd -
else
mkdir cmake-build
cd cmake-build
cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ..
make -j 4
ctest --output-on-failure --schedule-random --repeat-until-fail 7
make install
cd ..
fi
set +o errexit
after_script:
- |
if [ "$TRAVIS_TAG" ]; then
if [[ "v$TRAVIS_TAG" != "v$(sed -n 's/\([0-9]\{1,\}\(\.[0-9]\{1,\}\)\{1,\}\)/\1/p' .VERSION)" ]]; then
echo "ERROR: You are trying to tag a new release but have a version missmatch in \`.VERSION\`"
false # throw an error
fi
fi
after_success:
- find . -name '*.gcno' -print
- gcov-6 --version
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-6)
before_deploy:
- git archive -v --prefix "OpenCoarrays-${TRAVIS_TAG}/" -o "OpenCoarrays-${TRAVIS_TAG}.tar.gz" ${TRAVIS_TAG}
- |
echo '# To verify cryptographic checksums `shasum -c opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt` on Mac OS X,' > "opencoarrays-${TRAVIS_TAG}-SHA256.txt
echo '# `sha256sum -c opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt` on Linux.' >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
if [[ "X$(uname -s)" == "XDarwin" ]]; then
shasum -a 256 "OpenCoarrays-${TRAVIS_TAG}.tar.gz" >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
else
sha256sum "OpenCoarrays-${TRAVIS_TAG}.tar.gz" >> "opencoarrays-${TRAVIS_TAG}-SHA256.txt
fi
- |
set -o errexit
openssl aes-256-cbc -K $encrypted_ef4535c39461_key -iv $encrypted_ef4535c39461_iv -in subkey-328B3A0E-secret.asc.enc -out ./subkey-328B3A0E-secret.asc -d
gpg --allow-secret-key-import --import ./subkey-328B3A0E-secret.asc && rm subkey-328B3A0E-secret.asc
rm subkey-328B3A0E-secret.* || true
unset encrypted_ef4535c39461_key || true
unset encrypted_ef4535c39461_iv || true
gpg --armor --detach-sign -u 328B3A0E --comment 'Mac users can use GPGTools - https://gpgtools.org' \
--comment "Download Izaak Beekman's GPG public key from your" \
--comment 'trusted key server or from' \
--comment 'https://izaakbeekman.com/izaak.pubkey.txt' \
--comment 'Next add it to your GPG keyring, e.g.,' \
--comment '`curl https://izaakbeekman.com/izaak.pubkey.txt | gpg --import`' \
--comment "Make sure you have verified that the release archive's" \
--comment 'SHA256 checksum matches the provided' \
--comment "opencoarrays-${TRAVIS_TAG}-SHA256.txt and ensure that this file" \
--comment "and it's signature are in the same directory. Then" \
--comment 'verify with:' \
--comment '`gpg --verify opencoarrays-'"${TRAVIS_TAG}"'-SHA256.txt.asc`' \
"opencoarrays-${TRAVIS_TAG}-SHA256.txt"
set +o errexit
deploy:
provider: releases
api_key:
secure: lBj4VgKhU74xfzPc0CDIji6cFrN/xEQIHLHjMcnDPWEF5JQe79aunMS5qiYu5ttve6khGI1WMFEe7clUO3TXiDUPyRMS4M8B2q3fuvUIsIbYgWcKq7ut+x6+dEQDj4DE3yWpPb8IDugWFp4vno1eQ2Rid1yr6Vn+rjnbE2i6z5SkXPnIv1ziQ9G+TF4ChUA8IOd1T78gJmML86P0rbt6nW8eVuJbza2y1ggHAY//q/b6rrbOFw5PqiOBqZ/BRrKJ5d2U2mvsoZtNn4OYyXw4eKEvNDIydwaIZROXfPRmN9zJ5G7+01QA5jlXpq17KfPBr7MXkn7nrQ5q9Z2ji4hRHk/AFzM/etfl1k4WCshYs13NlORpnU0vZtCMmmmsXWxj2kpsOHLWZQKdUAPs3olMPIG6aVnO5Abk1vrVSNy/ZeknbBTKCGScET1qRSaj6d43ynBwGkqHgaJdLBAwGe0Dpap6SsLGsAg56ZqHTngGlXB1KsbJKMkUsSC5RAgEuh9m55nsMaRlTYTrv+YADAQts7lV8yMCciMeJlrd3EYryyn4ZY1O82eOofhZZ5vQUktbXHtg6YnzguFwQyn+9yY/CQfi/vu2Aoq79NJEO/9UJ82ogn6gOoIebzb0xgIONjw4M68luR2U1CXtibzSYKWLGTeOj43khqZdbOpp6xncIv0=
file:
- "OpenCoarrays-${TRAVIS_TAG}.tar.gz"
- "opencoarrays-${TRAVIS_TAG}-SHA256.txt"
- "opencoarrays-${TRAVIS_TAG}-SHA256.txt.asc"
skip_cleanup: true
on:
tags: true
# repo: sourceryinstitute/opencoarrays
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/93dbafbdf76c1732a623
- https://webhooks.gitter.im/e/935231573bf1b9f2fe40
on_success: change # options: [always|never|change]
on_failure: always
on_start: always