forked from sortmerna/sortmerna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
228 lines (208 loc) · 7.06 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
#==============================================================================
# FILE: .travis.yml
# Travis CI build configuration
#==============================================================================
# 20190708
# Build matrix is a Total Mess! Exclude seems to have no action at all. All the
# logic of 'include' and 'exclude' is unpredictable.
#
# OSX 'xcode10.2' packages Apple Clang 9.0 based on LLVM 7.0 and doesn't support
# <filesystem> at ALL (not even experimental)
#
# LLVM Clang 8.0 screws RocksDB on deprecations and doesn't support <filesystem>
#
# Wait until LLVM 9.0 which should be ready by the end of this year with
# <filesystem> support
#
# For now only build on Linux with GCC
#os:
# - linux
# - osx
#language: cpp
#compiler:
# - clang
# - gcc
#dist: xenial
#osx_image: xcode10.2
#addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-xenial-7
# packages:
# - gcc-9
# - g++-9
# - clang-7
#sudo: false # required
env:
global:
- OAUTH=""
- DO_DEPLOY=0
matrix:
include:
- os: linux
compiler: gcc
dist: xenial
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-9
- g++-9
env:
- MATRIX_EVAL="ENV=Linux_gcc-9 && CC=gcc-9 && CXX=g++-9"
- STATIC_LINK=1
- TEST=0
- OS_SFX="U16"
deploy:
provider: releases
api_key: "${OAUTH}"
file:
- ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}-static.sh
- ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}-static.deb
overwrite: true
skip_cleanup: true
on:
tags: true
condition: $DO_DEPLOY = 1 && $STATIC_LINK = 1
# - os: linux
# compiler: clang
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# the latest official clang on Xenial is clang-4.0 [https://packages.ubuntu.com/xenial/devel] => use llvm
# - llvm-toolchain-xenial-7
# - llvm-toolchain-trusty-6.0
# packages:
# - clang-7
# env:
# - MATRIX_EVAL="ENV=Linux_clang-7_LLVM && CC=clang-7 && CXX=clang++-7 && clang --version"
# - os: osx
# osx_image: xcode10.2 # xcode9.2 (macOS 10.12) xcode10.2 (macOS 10.14)
# compiler: clang
# env:
# - MATRIX_EVAL="ENV=Osx_clang-9.0_APPL && clang --version"
#- MATRIX_EVAL="CC=clang-9.0 && CXX=clang++-9.0" # this screws the Miniconda installation
# this is probably no different from osx+clang. MAC GCC seems to be just an interface to clang.
# - os: osx
# osx_image: xcode10.2 #
# compiler: gcc
# env:
# - MATRIX_EVAL="ENV=Osx_gcc_APPL && CC=gcc && CXX=g++ && gcc --version" # default gcc installed with OSX
#- MATRIX_EVAL="ENV=Osx+gcc-7 && brew install gcc && brew link --overwrite gcc && CC=gcc-7 && CXX=g++-7" # need to fix conflicts with pre-installed gcc
before_install:
- eval "${MATRIX_EVAL}"
# Used to work without this 20190708. Now it stubbornly uses pre-installed older GCC.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 ;
sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-9 60 ;
fi
install:
# $HOME /home/travis (Linux), /Users/travis (MacOS), /c/Users/travis (Windows)
- pushd $HOME
- env
- echo $PWD
- echo $PATH
- which gcc-9
- gcc-9 --version
- gcc --version
- echo $CC
- echo $CXX
# Python - Conda. Boot Conda using the existing Python 3
- which pyenv
- pyenv versions
- python3 --version
- pyenv global 3.7.1
#- pyenv install –-list # errors for some reason. Travis bug.
- which python3
- python3 --version
- which pip3
- pip3 --version
- pip3 install pyyaml
- pip3 install jinja2
- python3 $TRAVIS_BUILD_DIR/scripts/build.py --name conda
- ls -lrt $HOME
- export PATH="$HOME/miniconda3/bin:$PATH"
- which pip
- pip install numpy
- pip install scipy
- pip install scikit-bio
- which cmake
- cmake --version
#
# Upgrade CMake
#
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
CMAKE_SH=cmake-${CMAKE_VER}-Linux-x86_64.sh ;
wget ${CMAKE_URL}/v${CMAKE_VER}/${CMAKE_SH} ;
sudo apt remove cmake ;
sudo apt purge --auto-remove cmake ;
fi
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# brew upgrade cmake;
# brew install dos2unix;
# fi
- python $TRAVIS_BUILD_DIR/scripts/build.py --name cmake
- ls -lrt $HOME
# add CMake to PATH
- export PATH="$HOME/$(basename -- $(find $HOME -type d -name 'cmake-*x86_64'))/bin:$PATH"
- echo $PATH
- which cmake
- cmake --version
- popd
script:
# check C++17 <filesystem>
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
find /usr/include -type f -name 'filesystem' ;
find /usr/lib -type f -name '*fs.a' ;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ls -lrt /Applications ;
find /Applications -type f -name 'filesystem' ;
find /Applications -type f -name '*fs.a' ;
fi
# build SortmeRNA
- python $TRAVIS_BUILD_DIR/scripts/build.py --name all
# run tests
#- export PATH="$PWD/dist/bin:$PATH"
#- sortmerna --version
#- sortmerna -h
#- if [[ "$ENV" == "Linux+clang-7_LLVM" ]]; then python ./tests/test_sortmerna.py; fi
#- if [[ "$ENV" == "Linux+gcc-7" ]]; then python ./tests/test_sortmerna_zlib.py; fi
#after_success:
before_deploy:
- find ${TRAVIS_BUILD_DIR}/dist -type f
- echo "Deploying SMR version [${TRAVIS_TAG:1}]"
# add suffixes to installation files to indicate OS and linkage type
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ ${STATIC_LINK} == 1 ]]; then
mv ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.sh ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}-static.sh ;
mv ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.deb ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}-static.deb ;
else
mv ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.sh ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}.sh ;
mv ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.deb ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux-${OS_SFX}.deb ;
fi
fi
#- echo "Get git tag"
#- |
# xtag=$(git describe --exact-match HEAD 2>/dev/null); \
# if [[ ! -z "$xtag" ]]; then SMR_VER="${xtag:1}"; fi
- echo "Deploying SMR version [${TRAVIS_TAG:1}]"
- pwd
- env
# This fails with "401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)"
# useless until the 'org' to 'com' migration is done.
#deploy:
# provider: releases
# api_key: "GITHUB OAUTH TOKEN"
# file:
# - ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.sh
# - ${TRAVIS_BUILD_DIR}/dist/sortmerna-${TRAVIS_TAG:1}-Linux.tar.gz
# overwrite: true
# skip_cleanup: true
# on:
# tags: true
# condition: $ENV = "Linux+LLVM_clang-7"
## END .travis.yml