.travis.yml 1.8 KB
Newer Older
1
language: python
2

3 4 5 6
matrix:
  allow_failures:
    - python: "nightly"

7
python:
8
    - "2.7"
9
    - "3.4"
10 11
    - "3.5"
    - "3.6"
12
    - "nightly"
13

14 15
env:
    - AVOCADO_PARALLEL_LINT=1
16 17 18 19
      AVOCADO_PARALLEL_CHECK=yes
      AVOCADO_LOG_DEBUG=yes
      SELF_CHECK_CONTINUOUS=y
      AVOCADO_CHECK_LEVEL=1
20

21 22 23
branches:
    only:
        - master
C
Cleber Rosa 已提交
24
        - 52lts
25
        - 69lts
26

27 28 29 30
cache:
    directories:
        - $HOME/.cache/pip

31 32 33
addons:
  apt:
    packages:
A
Amador Pahim 已提交
34
    - libvirt-dev
35

36
install:
37
    - pip install -r requirements-selftests.txt
38 39

script:
40
    - |
41
        # First cleanup the previously installed files
42 43
        PYTHON=$(which python)
        $(PYTHON) setup.py develop --uninstall
44 45 46 47
        BINDIR=$(dirname $(which python))
        for FILE in scripts/*; do
            rm $BINDIR/$(basename $FILE)
        done
48
        # Run the "make check" per each commit in PR (TRAVIS_COMMIT_RANGE)
49
        ERR=""
50
        echo Branch is $TRAVIS_BRANCH
51 52 53 54 55 56 57 58
        if [ "$TRAVIS_PULL_REQUEST_SHA" ]; then
            # It's pull request, check only PR commits
            COMMITS="$(git cherry origin/master | sed -n 's/+ \(.*\)/\1/p')"
        else
            # push check, try to check everything
            COMMITS=$(git rev-list $TRAVIS_COMMIT_RANGE)
        fi
        for COMMIT in $COMMITS; do
59 60 61 62 63
            echo
            echo "--------------------< $(git log -1 --oneline $COMMIT) >--------------------"
            echo
            echo
            git checkout $COMMIT || ERR=$(echo -e "$ERR\nUnable to checkout $(git log -1 --oneline $COMMIT)")
64 65
            make PYTHON=$PYTHON check || ERR=$(echo -e "$ERR\nmake check of $(git log -1 --oneline) failed")
            make PYTHON=$PYTHON clean
66 67 68 69 70 71
        done
        if [ "$ERR" ]; then
            echo
            echo "Incremental smokecheck failed: $ERR"
            exit -1
        fi