Skip to content

Commit

Permalink
add continuous integration using travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed May 21, 2016
1 parent b52ca61 commit 42f4355
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ MANIFEST
.tox
.coverage
*.egg-info
.*.swp
44 changes: 44 additions & 0 deletions .travis.yml
@@ -0,0 +1,44 @@
language: generic
sudo: false
matrix:
include:
# - os: osx
# env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="32"
- os: osx
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="64"
# - os: osx
# env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="32"
- os: osx
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="64"
# - os: osx
# env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="32"
- os: osx
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="64"
# - os: linux
# env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="2.7" PYTHON_ARCH="64"
# - os: linux
# env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.4" PYTHON_ARCH="64"
# - os: linux
# env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="32"
- os: linux
env: DEPS="numpy" PYTHON_VERSION="3.5" PYTHON_ARCH="64"

before_install:
- uname -a
- lsb_release -a
- source "ci/travis/conda_setup.sh"

install:
- source "ci/travis/conda_install.sh"

script:
- python "tools/test-installed-bottleneck.py"

notifications:
email:
on_success: never
on_failure: always
12 changes: 12 additions & 0 deletions ci/travis/conda_install.sh
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -uev # error if unset variables, exit on first error, print commands

if [ "${PYTHON_ARCH}" == "32" ]; then
set CONDA_FORCE_32BIT=1
fi
NAME="test-${PYTHON_VERSION}-${PYTHON_ARCH}bit"
conda create -q -n "${NAME}" "${DEPS}" python="${PYTHON_VERSION}"
source activate "${NAME}"
conda info -a
conda list
28 changes: 28 additions & 0 deletions ci/travis/conda_setup.sh
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -uev # error if unset variables, exit on first error, print commands

MINICONDA_URL="http://repo.continuum.io/miniconda"

if [ "${PYTHON_VERSION:0:1}" == "2" ]; then
MINICONDA="Miniconda2"
else
MINICONDA="Miniconda3"
fi
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
MINICONDA_OS="MacOSX"
else
MINICONDA_OS="Linux"
fi
if [ "${PYTHON_ARCH}" == "64" ]; then
URL="${MINICONDA_URL}/${MINICONDA}-latest-${MINICONDA_OS}-x86_64.sh"
else
URL="${MINICONDA_URL}/${MINICONDA}-latest-${MINICONDA_OS}-x86.sh"
fi
travis_retry wget "${URL}" -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p "${HOME}/miniconda"
export PATH="${HOME}/miniconda/bin:${PATH}"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda

0 comments on commit 42f4355

Please sign in to comment.