109 lines
3.6 KiB
YAML
109 lines
3.6 KiB
YAML
sudo: required
|
|
dist: xenial
|
|
language: python
|
|
python: "3.7"
|
|
|
|
jobs:
|
|
include:
|
|
|
|
- stage: code quality
|
|
name: "pylint lbrynet"
|
|
install:
|
|
- pip install astroid==2.0.4
|
|
# newer astroid fails in pylint so we pre-install older version
|
|
- pip install pylint
|
|
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
|
- pip install -e .
|
|
script: pylint lbrynet
|
|
|
|
- &tests
|
|
stage: test
|
|
name: "Unit Tests"
|
|
install:
|
|
- pip install coverage
|
|
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
|
- pip install -e .[test]
|
|
script:
|
|
- HOME=/tmp coverage run -p --source=lbrynet -m unittest discover -v tests.unit.wallet
|
|
- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.analytics tests.unit.components tests.unit.core tests.unit.cryptstream tests.unit.database tests.unit.dht tests.unit.lbryfilemanager tests.unit.lbrynet_daemon tests.unit.test_cli tests.unit.test_customLogger
|
|
after_success:
|
|
- coverage combine
|
|
- bash <(curl -s https://codecov.io/bash)
|
|
|
|
- <<: *tests
|
|
name: "DHT Tests"
|
|
script: HOME=/tmp coverage run --source=lbrynet -m twisted.trial --reactor=asyncio tests.functional
|
|
|
|
- name: "Integration Tests"
|
|
install:
|
|
- pip install tox-travis coverage
|
|
- pushd .. && git clone https://github.com/lbryio/torba.git && popd
|
|
script: tox
|
|
after_success:
|
|
- coverage combine tests/
|
|
- bash <(curl -s https://codecov.io/bash)
|
|
|
|
- stage: build
|
|
name: "Windows"
|
|
language: generic
|
|
services:
|
|
- docker
|
|
install:
|
|
- docker pull lbry/pyinstaller34_32bits:py371
|
|
script:
|
|
- docker run -v "$(pwd):/src/lbry" lbry/pyinstaller34_32bits:py371 lbry/scripts/wine_build.sh
|
|
- sudo zip -j dist/lbrynet-windows.zip dist/lbrynet.exe
|
|
addons:
|
|
artifacts:
|
|
working_dir: dist
|
|
paths:
|
|
- lbrynet-windows.zip
|
|
target_paths:
|
|
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/win/
|
|
|
|
- &build
|
|
name: "Linux"
|
|
install:
|
|
- pip3 install pyinstaller
|
|
- pip3 install git+https://github.com/lbryio/torba.git
|
|
- python scripts/set_build.py
|
|
- pip3 install -e .
|
|
script:
|
|
- pyinstaller -F -n lbrynet lbrynet/extras/cli.py
|
|
- chmod +x dist/lbrynet
|
|
- zip -j dist/lbrynet-${OS}.zip dist/lbrynet
|
|
- ./dist/lbrynet --version
|
|
env: OS=linux
|
|
addons:
|
|
artifacts:
|
|
working_dir: dist
|
|
paths:
|
|
- lbrynet-${OS}.zip
|
|
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
|
|
target_paths:
|
|
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})/${OS}/lbrynet
|
|
|
|
- <<: *build
|
|
name: "Mac"
|
|
os: osx
|
|
osx_image: xcode8
|
|
language: generic
|
|
env: OS=mac
|
|
cache: false
|
|
install:
|
|
#- brew update
|
|
- brew upgrade python
|
|
- python --version
|
|
- pip --version
|
|
- pip install pyinstaller
|
|
- git clone https://github.com/lbryio/torba.git --depth 1
|
|
- sed -i -e "s/'plyvel',//" torba/setup.py
|
|
- cd torba && pip install -e . && cd ..
|
|
- python scripts/set_build.py
|
|
- pip install -e .
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.cache/pip
|
|
- $HOME/Library/Caches/pip
|
|
- $TRAVIS_BUILD_DIR/.tox
|