Skip to content

Commit

Permalink
.travis.yml: Use travis template
Browse files Browse the repository at this point in the history
  • Loading branch information
jayvdb committed Aug 5, 2019
1 parent 5ece789 commit 912fe40
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 38 deletions.
15 changes: 0 additions & 15 deletions .ci/check_moban.sh

This file was deleted.

12 changes: 8 additions & 4 deletions .moban.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ dependencies:
- gemfileparser~=0.6.2
- pyjsparser~=2.4.5

requires:
- type: git
url: https://gitlab.com/jayvdb/mobans
branch: custom-travis-template

configuration:
template_dir:
- ../coala-mobans/templates/
- ../coala-mobans/assets/
- mobans:templates/
- mobans:assets/
configuration: .moban.yaml
configuration_dir: ../coala-mobans/
configuration_dir: 'mobans:'
targets:
- Fudgefile: Fudgefile.jj2
- .ci/constants.ps1: constants.ps1.jj2
Expand All @@ -59,6 +63,6 @@ targets:
- test-requirements.txt: test-requirements.txt.jj2
- coala_quickstart/VERSION: VERSION.jj2
- coala_quickstart/__init__.py: __init__.py.jj2
- .travis.yml: ci/coala-travis.yml.jj2
- .ci/appveyor.yml: ci/appveyor.yml.jj2
- .ci/run_with_env.cmd: run_with_env.cmd
- .ci/check_moban.sh: ci/check_moban.sh
97 changes: 78 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,114 @@
sudo: false
dist: xenial
language: python
notifications:
email: false
python:
- 3.4
- 3.5
- 3.6
- 3.7

stages:
- test
- moban

.disable_global: &disable_global
addons: false
cache: false
env: {}
python: false
before_install: false
install: false
before_script: false
script: false
after_success: false
after_failure: false
before_deploy: false
deploy: false

.check_moban: &check_moban
.moban: &moban
<<: *disable_global
python: 3.6
stage: moban
install: pip install moban
script: .ci/check_moban.sh
install: pip install moban>=0.0.4
script:
- moban
- git diff --exit-code

jobs:
include:
- *check_moban
- stage: moban
<<: *moban
if: branch = master AND type = push
- *moban
allow_failures:
- *moban

stage: test

env:
global:
- BEARS_ZIP_URL=https://codeload.github.com/coala/coala-bears/zip
- GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
- JDK="[email protected]"

cache:
pip: true
directories:
# coala managed data
- ~/nltk_data
- ~/.jabba

before_install:
- pip install setuptools -U
- printf '%s\n'
"$(cat test-requirements.txt requirements.txt)"
> requirements.txt
- curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh

script:
- pytest
- pip install -e .
# https://github.com/coala/coala-bears/issues/1037
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
sed -i.bak '/bears = GitCommitBear/d' .coafile
if [[ $TRAVIS_OS_NAME == osx ]]; then
brew install python3
sudo ln -sf $(which python3) $(which python)
sudo ln -sf $(which pip3) $(which pip 2>/dev/null || echo /usr/bin/pip)
fi
# See rationale in .ci/deps.python-packages.ps1 for pre-installing these
- pip install --prefer-binary cffi lxml
# Use pip 9, so that setuptools can be downgraded.
# https://github.com/coala/coala/issues/4708
# Apart from builds with python 2.7 and 3.5, it installs setuptools
# twice. So, it is required to uninstall one version manually.
- pip uninstall setuptools --yes
- pip uninstall setuptools --yes || true
- pip uninstall setuptools --yes || true
- pip uninstall pipenv --yes || true
- pip install pip==9.0.1 setuptools==21.2.2

# https://github.com/coala/coala/issues/3183
# Travis automatically installs the `requirements.txt` in "install" stage
- cp requirements.txt requirements.orig
- cat test-requirements.txt >> requirements.txt
- sed -i.bak '/^-r/d' requirements.txt

# OSX is not a real Travis 'python' image, so it does not install
# requirements.txt automatically.
- if [[ $TRAVIS_OS_NAME == osx ]]; then pip install -r requirements.txt; fi
- source ~/.install-jdk-travis.sh

before_script:
# Restore the original requirements.txt
- mv requirements.orig requirements.txt

script:
- py.test
- python setup.py bdist_wheel
- pip install ./dist/*.whl
- curl -fsSL -o coala-bears.zip $BEARS_ZIP_URL/master
- pip install coala-bears.zip[alldeps]
- coala --non-interactive

notifications:
email: false
webhooks: https://www.travisbuddy.com/
on_success: never
after_success:
- codecov

after_failure:
- codecov

branches:
exclude:
Expand Down

0 comments on commit 912fe40

Please sign in to comment.