.travis.yml 1.49 KB
Newer Older
1 2
sudo: false
os: linux
3
language: python
4 5 6 7 8 9 10 11 12 13
cache:
  - ccache
  - pip
services:
  - docker

env:
  global:
    - BUILD=pytest

14 15 16
matrix:
  include:
    - python: 2.7
17
      env: TOX_ENV="py27-{generator,noaccel,accel-nix,streams}"
18
    - python: 3.3
19
      env: TOX_ENV="py33-{generator,noaccel,accel-nix,streams}"
20
    - python: 3.4
21
      env: TOX_ENV="py34-{generator,noaccel,accel-nix,streams}"
22
    - python: 3.5
23
      env: TOX_ENV="py35-{generator,noaccel,accel-nix,streams}"
24
    - python: 3.6
25
      env: TOX_ENV="py36-{generator,noaccel,accel-nix,streams}"
26 27
    - env: BUILD=cmake

28
install:
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
  - |
    if [[ $BUILD == pytest ]]; then
      pip install tox
    else
      wget https://github.com/grammarly/rocker/releases/download/1.3.1/rocker-1.3.1-linux_amd64.tar.gz
      tar xvf rocker-1.3.1-linux_amd64.tar.gz
      rm rocker-1.3.1-linux_amd64.tar.gz
    fi

before_script:
  - |
    if [[ $BUILD != pytest ]]; then
      mkdir -p -m777 ~/.ccache
    fi

44
script:
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
  - |
    if [[ $BUILD == pytest ]]; then
      tox -e $TOX_ENV
    else
      ./rocker build -f docker/Rockerfile.piglit ${DOCKER_TAG:+--var TAG=}${DOCKER_TAG} ${DOCKER_IMAGE:+--var IMAGE=}${DOCKER_IMAGE} ${DOCKER_PARENT:+--var PARENT=}${DOCKER_PARENT} .
    fi

after_success:
  - |
    if [[ $BUILD != pytest ]]; then
      if [[ -n $DOCKER_IMAGE && -n $DOCKER_TAG && -n $DOCKER_USERNAME && $TRAVIS_BRANCH == master ]]; then
        docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
        docker push "${DOCKER_IMAGE}":"${DOCKER_TAG}"
      fi
    fi