Skip to content

Commit 912fe40

Browse files
committed
.travis.yml: Use travis template
Implements https://gitlab.com/coala/mobans/merge_requests/135
1 parent 5ece789 commit 912fe40

3 files changed

Lines changed: 86 additions & 38 deletions

File tree

.ci/check_moban.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

.moban.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ dependencies:
3333
- gemfileparser~=0.6.2
3434
- pyjsparser~=2.4.5
3535

36+
requires:
37+
- type: git
38+
url: https://gitlab.com/jayvdb/mobans
39+
branch: custom-travis-template
3640

3741
configuration:
3842
template_dir:
39-
- ../coala-mobans/templates/
40-
- ../coala-mobans/assets/
43+
- mobans:templates/
44+
- mobans:assets/
4145
configuration: .moban.yaml
42-
configuration_dir: ../coala-mobans/
46+
configuration_dir: 'mobans:'
4347
targets:
4448
- Fudgefile: Fudgefile.jj2
4549
- .ci/constants.ps1: constants.ps1.jj2
@@ -59,6 +63,6 @@ targets:
5963
- test-requirements.txt: test-requirements.txt.jj2
6064
- coala_quickstart/VERSION: VERSION.jj2
6165
- coala_quickstart/__init__.py: __init__.py.jj2
66+
- .travis.yml: ci/coala-travis.yml.jj2
6267
- .ci/appveyor.yml: ci/appveyor.yml.jj2
6368
- .ci/run_with_env.cmd: run_with_env.cmd
64-
- .ci/check_moban.sh: ci/check_moban.sh

.travis.yml

Lines changed: 78 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,114 @@
1+
sudo: false
2+
dist: xenial
13
language: python
4+
notifications:
5+
email: false
26
python:
37
- 3.4
48
- 3.5
59
- 3.6
10+
- 3.7
611

712
stages:
813
- test
914
- moban
1015

1116
.disable_global: &disable_global
17+
addons: false
18+
cache: false
19+
env: {}
20+
python: false
1221
before_install: false
1322
install: false
23+
before_script: false
1424
script: false
25+
after_success: false
26+
after_failure: false
27+
before_deploy: false
28+
deploy: false
1529

16-
.check_moban: &check_moban
30+
.moban: &moban
1731
<<: *disable_global
1832
python: 3.6
1933
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
2238

2339
jobs:
2440
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"
2655

2756
cache:
2857
pip: true
2958
directories:
30-
# coala managed data
3159
- ~/nltk_data
60+
- ~/.jabba
3261

3362
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
3864

39-
script:
40-
- pytest
41-
- pip install -e .
42-
# https://github.com/coala/coala-bears/issues/1037
4365
- >
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)
4670
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]
47105
- coala --non-interactive
48106

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
53112

54113
branches:
55114
exclude:

0 commit comments

Comments
 (0)