Travis has long been language: python OSX build is broken so I have to fight with language: c It doesn't become.
There is an actual yml at https://github.com/chezou/fastFM/blob/travis-conda/.travis.yml, I usually write like this.
It feels like writing a Python version in env.
.travis.yml
language: c
env:
    - TRAVIS_PYTHON_VERSION="2.7"
    - TRAVIS_PYTHON_VERSION="3.5"
os:
    - linux
    - osx
before_install:
    - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
    - # install some brew package
    - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq;  fi
    - # install some apt package
    - if [[ "$TRAVIS_PYTHON_VERSION" =~ "^2" ]]; then
        if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
          wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
        else
          wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh;
        fi
      else
        if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
          wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
        else
          wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
        fi
      fi
    - bash 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
    # Useful for debugging any issues with conda
    - conda info -a
    - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION # some needed packages
    - source activate test-environment
install:
    - pip install .
script:
    - nosetests
It's painful, but testing the code used with Cython takes 20 minutes for CI without Miniconda, so it can't be helped.
Recommended Posts