|
| 1 | +sudo: false |
| 2 | +dist: xenial |
1 | 3 | language: python |
| 4 | +notifications: |
| 5 | + email: false |
2 | 6 | python: |
3 | 7 | - 3.4 |
4 | 8 | - 3.5 |
5 | 9 | - 3.6 |
| 10 | + - 3.7 |
6 | 11 |
|
7 | 12 | stages: |
8 | 13 | - test |
9 | 14 | - moban |
10 | 15 |
|
11 | 16 | .disable_global: &disable_global |
| 17 | + addons: false |
| 18 | + cache: false |
| 19 | + env: {} |
| 20 | + python: false |
12 | 21 | before_install: false |
13 | 22 | install: false |
| 23 | + before_script: false |
14 | 24 | script: false |
| 25 | + after_success: false |
| 26 | + after_failure: false |
| 27 | + before_deploy: false |
| 28 | + deploy: false |
15 | 29 |
|
16 | | -.check_moban: &check_moban |
| 30 | +.moban: &moban |
17 | 31 | <<: *disable_global |
18 | 32 | python: 3.6 |
19 | 33 | stage: moban |
20 | | - install: pip install moban |
21 | | - script: .ci/check_moban.sh |
| 34 | + install: pip install moban>=0.0.4 |
| 35 | + script: |
| 36 | + - moban |
| 37 | + - git diff --exit-code |
22 | 38 |
|
23 | 39 | jobs: |
24 | 40 | include: |
25 | | - - *check_moban |
| 41 | + - stage: moban |
| 42 | + <<: *moban |
| 43 | + if: branch = master AND type = push |
| 44 | + - *moban |
| 45 | + allow_failures: |
| 46 | + - *moban |
| 47 | + |
| 48 | +stage: test |
| 49 | + |
| 50 | +env: |
| 51 | + global: |
| 52 | + - BEARS_ZIP_URL=https://codeload.github.com/coala/coala-bears/zip |
| 53 | + - GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/" |
| 54 | + - JDK="adopt@1.8.212-04" |
26 | 55 |
|
27 | 56 | cache: |
28 | 57 | pip: true |
29 | 58 | directories: |
30 | | - # coala managed data |
31 | 59 | - ~/nltk_data |
| 60 | + - ~/.jabba |
32 | 61 |
|
33 | 62 | before_install: |
34 | | - - pip install setuptools -U |
35 | | - - printf '%s\n' |
36 | | - "$(cat test-requirements.txt requirements.txt)" |
37 | | - > requirements.txt |
| 63 | + - curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh |
38 | 64 |
|
39 | | -script: |
40 | | - - pytest |
41 | | - - pip install -e . |
42 | | - # https://github.com/coala/coala-bears/issues/1037 |
43 | 65 | - > |
44 | | - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then |
45 | | - sed -i.bak '/bears = GitCommitBear/d' .coafile |
| 66 | + if [[ $TRAVIS_OS_NAME == osx ]]; then |
| 67 | + brew install python3 |
| 68 | + sudo ln -sf $(which python3) $(which python) |
| 69 | + sudo ln -sf $(which pip3) $(which pip 2>/dev/null || echo /usr/bin/pip) |
46 | 70 | fi |
| 71 | +
|
| 72 | + # See rationale in .ci/deps.python-packages.ps1 for pre-installing these |
| 73 | + - pip install --prefer-binary cffi lxml |
| 74 | + # Use pip 9, so that setuptools can be downgraded. |
| 75 | + # https://github.com/coala/coala/issues/4708 |
| 76 | + # Apart from builds with python 2.7 and 3.5, it installs setuptools |
| 77 | + # twice. So, it is required to uninstall one version manually. |
| 78 | + - pip uninstall setuptools --yes |
| 79 | + - pip uninstall setuptools --yes || true |
| 80 | + - pip uninstall setuptools --yes || true |
| 81 | + - pip uninstall pipenv --yes || true |
| 82 | + - pip install pip==9.0.1 setuptools==21.2.2 |
| 83 | + |
| 84 | + # https://github.com/coala/coala/issues/3183 |
| 85 | + # Travis automatically installs the `requirements.txt` in "install" stage |
| 86 | + - cp requirements.txt requirements.orig |
| 87 | + - cat test-requirements.txt >> requirements.txt |
| 88 | + - sed -i.bak '/^-r/d' requirements.txt |
| 89 | + |
| 90 | + # OSX is not a real Travis 'python' image, so it does not install |
| 91 | + # requirements.txt automatically. |
| 92 | + - if [[ $TRAVIS_OS_NAME == osx ]]; then pip install -r requirements.txt; fi |
| 93 | + - source ~/.install-jdk-travis.sh |
| 94 | + |
| 95 | +before_script: |
| 96 | + # Restore the original requirements.txt |
| 97 | + - mv requirements.orig requirements.txt |
| 98 | + |
| 99 | +script: |
| 100 | + - py.test |
| 101 | + - python setup.py bdist_wheel |
| 102 | + - pip install ./dist/*.whl |
| 103 | + - curl -fsSL -o coala-bears.zip $BEARS_ZIP_URL/master |
| 104 | + - pip install coala-bears.zip[alldeps] |
47 | 105 | - coala --non-interactive |
48 | 106 |
|
49 | | -notifications: |
50 | | - email: false |
51 | | - webhooks: https://www.travisbuddy.com/ |
52 | | - on_success: never |
| 107 | +after_success: |
| 108 | + - codecov |
| 109 | + |
| 110 | +after_failure: |
| 111 | + - codecov |
53 | 112 |
|
54 | 113 | branches: |
55 | 114 | exclude: |
|
0 commit comments