Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .CI/travis/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Build the project

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
python${PYTHON_VERSION} setup.py install
else
python setup.py install
fi

coverage run -m unittest discover tests/unit_tests *_tests.py -f -v

35 changes: 35 additions & 0 deletions .CI/travis/install-arrayfire.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install fftw freeimage
if [ ! -e "./installers/arrayfire-no-gl.pkg" ]; then
wget https://github.com/shapelets/arrayfire/releases/download/v3.6.2/arrayfire-no-gl.pkg -O installers/arrayfire-no-gl.pkg
fi

# Installs arrayfire
sudo installer -pkg ./installers/arrayfire-no-gl.pkg -target /
else
sudo apt-get update && \
sudo apt-get install -y libboost-all-dev \
libfftw3-dev \
libfontconfig1-dev \
libfreeimage-dev \
liblapack-dev \
liblapacke-dev \
libopenblas-dev

if [ ! -e "./installers/arrayfire-no-gl.sh" ]; then
wget https://github.com/shapelets/arrayfire/releases/download/v3.6.2/arrayfire-no-gl.sh -O installers/arrayfire-no-gl.sh
fi

sudo mkdir -p /opt/arrayfire-3
sudo bash installers/arrayfire-no-gl.sh --prefix=/opt/arrayfire-3 --skip-license
sudo ln -s /opt/arrayfire-3/lib64 /opt/arrayfire-3/lib
echo "/opt/arrayfire-3/lib" | sudo tee /etc/ld.so.conf.d/arrayfire.conf
sudo ldconfig
fi
68 changes: 68 additions & 0 deletions .CI/travis/install-khiva.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if [[ "$INSTALL_KHIVA_METHOD" == "installer" ]]; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [ ! -e "./installers/khiva-v0.2.2.pkg" ]; then
wget https://github.com/shapelets/khiva/releases/download/v0.2.2/khiva-v0.2.2.pkg -O ./installers/khiva-v0.2.2.pkg
fi
# Installs Khiva
sudo installer -pkg ./installers/khiva-v0.2.2.pkg -target /
else
if [ ! -e "./installers/khiva-v0.2.2-ci.sh" ]; then
wget https://github.com/shapelets/khiva/releases/download/v0.2.2/khiva-v0.2.2.sh -O ./installers/khiva-v0.2.2.sh
chmod +x ./installers/khiva-v0.2.2.sh
fi
sudo ./installers/khiva-v0.2.2.sh --prefix=/usr/local --skip-license
sudo ldconfig
fi

else
# GitHub method
# Install cmake in Linux, it is already installed in osx
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# Check if the file already exists
if [ ! -e "${TRAVIS_BUILD_DIR}/cmakebin/cmake-3.13.2-Linux-x86_64.sh" ]; then
mkdir -p cmakebin
wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh -O cmakebin/cmake-3.13.2-Linux-x86_64.sh
fi
# Install cmake
sudo bash cmakebin/cmake-3.13.2-Linux-x86_64.sh --prefix=./cmakebin/ --skip-license
fi

#Installing conan and dependencies
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
pip install conan
else
pip${PYTHON_VERSION} install conan==1.6.1
fi

conan remote add conan-mpusz https://api.bintray.com/conan/mpusz/conan-mpusz
if [ $? -ne 0 ]; then
conan remote update conan-mpusz https://api.bintray.com/conan/mpusz/conan-mpusz
fi

# Cloning Github repo into khiva-library folder
git clone https://github.com/shapelets/khiva.git khiva-library
cd khiva-library
mkdir -p build && cd build
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
conan install .. -s compiler=apple-clang -s compiler.version=9.1 -s compiler.libcxx=libc++ --build missing
cmake .. -DKHIVA_ONLY_CPU_BACKEND=ON -DKHIVA_BUILD_DOCUMENTATION=OFF -DKHIVA_BUILD_EXAMPLES=OFF -DKHIVA_BUILD_BENCHMARKS=OFF
make install -j8
else
conan install .. -s compiler.libcxx=libstdc++11 --build missing
../../cmakebin/bin/cmake .. -DKHIVA_ENABLE_COVERAGE=ON -DKHIVA_BUILD_DOCUMENTATION=OFF -DKHIVA_BUILD_EXAMPLES=OFF -DKHIVA_BUILD_BENCHMARKS=OFF
sudo make install -j8
sudo ldconfig
fi
# Switching back to the khiva-python folder
cd ..
cd ..
fi


20 changes: 20 additions & 0 deletions .CI/travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew upgrade pyenv
export PATH=$HOME/.pyenv/shims:$HOME/.pyenv/versions/${TRAVIS_PYTHON_VERSION}/bin:$PATH
export PYTHON_VERSION=$(echo $TRAVIS_PYTHON_VERSION | awk -F'.' '{print $1 "." $2}')
pyenv install ${TRAVIS_PYTHON_VERSION} -s
pyenv init -

pyenv local ${TRAVIS_PYTHON_VERSION}

python${PYTHON_VERSION} --version

pip${PYTHON_VERSION} install --upgrade pip
fi
14 changes: 14 additions & 0 deletions .CI/travis/install_requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
pip${PYTHON_VERSION} install -r requirements.txt
pip${PYTHON_VERSION} install codecov
else
pip install -r requirements.txt
pip install codecov
fi
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2019 Shapelets.io
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

language: python

matrix:
fast_finish: true
include:
- os: linux
dist: xenial
sudo: required
python: "3.6"
before_install:
- openssl aes-256-cbc -K $encrypted_94fb5708c762_key -iv $encrypted_94fb5708c762_iv -in Credential.enc -out Aljuaritmo-3ac32e58ff41.json -d
cache:
directories:
- ${TRAVIS_BUILD_DIR}/installers
- ${HOME}/.conan
- ${TRAVIS_BUILD_DIR}/cmakebin
after_success:
- codecov -F Linux -X gcov
- os: osx
osx_image: xcode9.3
language: generic
env:
- TRAVIS_PYTHON_VERSION=3.6.5
before_install:
- openssl aes-256-cbc -K $encrypted_94fb5708c762_key -iv $encrypted_94fb5708c762_iv -in Credential.enc -out Aljuaritmo-3ac32e58ff41.json -d
cache:
directories:
- ${TRAVIS_BUILD_DIR}/installers
- $HOME/.pyenv
- $HOME/Library/Caches/Homebrew
- ${HOME}/.conan
after_success:
- codecov -F MacOS -X gcov
install:
- export GOOGLE_APPLICATION_CREDENTIALS=Aljuaritmo-3ac32e58ff41.json
- source .CI/travis/install.sh
- source .CI/travis/install-arrayfire.sh
- source .CI/travis/install-khiva.sh
- source .CI/travis/install_requirements.sh

script:
- source .CI/travis/build_and_test.sh
Binary file added Credential.enc
Binary file not shown.
Loading