2018-07-24 03:06:53 -04:00
|
|
|
sudo: required
|
2018-07-21 19:32:05 -04:00
|
|
|
dist: xenial
|
2017-02-15 11:10:40 -06:00
|
|
|
language: python
|
2018-07-29 00:24:38 -04:00
|
|
|
python: "3.7"
|
2017-02-15 11:10:40 -06:00
|
|
|
|
2018-07-21 19:32:05 -04:00
|
|
|
jobs:
|
|
|
|
include:
|
2017-10-25 12:26:04 -04:00
|
|
|
|
2018-07-26 19:18:48 -04:00
|
|
|
- stage: code quality
|
|
|
|
name: "pylint lbrynet"
|
|
|
|
install:
|
2019-01-07 02:52:53 -05:00
|
|
|
- pip install astroid==2.0.4 aiohttp==3.4.4
|
|
|
|
# newer astroid and aiohttp fails in pylint so we pre-install older version
|
2018-07-26 19:18:48 -04:00
|
|
|
- pip install pylint
|
2018-11-20 18:21:53 -05:00
|
|
|
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
|
|
|
- pip install -e .
|
2018-07-26 19:18:48 -04:00
|
|
|
script: pylint lbrynet
|
|
|
|
|
2019-01-22 17:45:36 -05:00
|
|
|
- stage: test
|
2018-11-26 18:52:27 -03:00
|
|
|
name: "Unit Tests"
|
2018-07-26 19:18:48 -04:00
|
|
|
install:
|
|
|
|
- pip install coverage
|
2018-11-20 18:21:53 -05:00
|
|
|
- pip install git+https://github.com/lbryio/torba.git#egg=torba
|
2019-01-23 18:22:10 -05:00
|
|
|
- pip install -e .
|
2018-10-15 23:04:04 -04:00
|
|
|
script:
|
2019-01-22 17:45:36 -05:00
|
|
|
- HOME=/tmp coverage run -p --source=lbrynet -m unittest discover -vv tests.unit
|
2018-07-27 17:56:13 -04:00
|
|
|
after_success:
|
2018-10-15 23:04:04 -04:00
|
|
|
- coverage combine
|
2018-07-27 17:56:13 -04:00
|
|
|
- bash <(curl -s https://codecov.io/bash)
|
2018-08-22 01:12:46 -03:00
|
|
|
|
2019-01-23 18:04:16 -05:00
|
|
|
- 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)
|
|
|
|
|
2018-07-24 03:06:53 -04:00
|
|
|
- stage: build
|
2018-07-26 19:18:48 -04:00
|
|
|
name: "Windows"
|
2018-07-29 10:55:30 -04:00
|
|
|
language: generic
|
2018-07-26 19:18:48 -04:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
install:
|
2018-11-26 18:17:36 -03:00
|
|
|
- docker pull lbry/pyinstaller34_32bits:py371
|
2018-07-26 19:18:48 -04:00
|
|
|
script:
|
2018-12-10 20:52:13 -03:00
|
|
|
- python scripts/set_build.py
|
2018-11-26 18:17:36 -03:00
|
|
|
- docker run -v "$(pwd):/src/lbry" lbry/pyinstaller34_32bits:py371 lbry/scripts/wine_build.sh
|
2018-09-26 19:18:53 -04:00
|
|
|
- sudo zip -j dist/lbrynet-windows.zip dist/lbrynet.exe
|
2018-12-11 23:24:19 -05:00
|
|
|
deploy:
|
|
|
|
provider: releases
|
|
|
|
api_key: $GITHUB_OAUTH_TOKEN
|
|
|
|
file: dist/lbrynet-windows.zip
|
|
|
|
skip_cleanup: true
|
|
|
|
overwrite: true
|
|
|
|
draft: true
|
2018-12-12 00:10:39 -05:00
|
|
|
on:
|
|
|
|
tags: true
|
2018-07-26 19:18:48 -04:00
|
|
|
addons:
|
|
|
|
artifacts:
|
|
|
|
working_dir: dist
|
|
|
|
paths:
|
2018-09-26 17:52:21 -04:00
|
|
|
- lbrynet-windows.zip
|
2018-07-26 19:18:48 -04:00
|
|
|
target_paths:
|
2018-12-08 14:45:53 -05:00
|
|
|
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})
|
2018-07-26 19:18:48 -04:00
|
|
|
|
2018-07-29 00:16:57 -04:00
|
|
|
- &build
|
|
|
|
name: "Linux"
|
2018-12-11 23:24:19 -05:00
|
|
|
env: OS=linux
|
2018-07-26 18:08:26 -04:00
|
|
|
install:
|
2018-07-26 19:13:14 -04:00
|
|
|
- pip3 install pyinstaller
|
|
|
|
- pip3 install git+https://github.com/lbryio/torba.git
|
2018-11-04 02:44:47 -05:00
|
|
|
- python scripts/set_build.py
|
2018-07-26 19:13:14 -04:00
|
|
|
- pip3 install -e .
|
2018-07-24 03:06:53 -04:00
|
|
|
script:
|
2018-11-04 15:51:27 -05:00
|
|
|
- pyinstaller -F -n lbrynet lbrynet/extras/cli.py
|
2018-09-26 15:54:40 -04:00
|
|
|
- chmod +x dist/lbrynet
|
2018-09-26 17:52:21 -04:00
|
|
|
- zip -j dist/lbrynet-${OS}.zip dist/lbrynet
|
2018-07-26 22:04:43 -04:00
|
|
|
- ./dist/lbrynet --version
|
2018-12-11 23:24:19 -05:00
|
|
|
deploy:
|
|
|
|
provider: releases
|
|
|
|
api_key: $GITHUB_OAUTH_TOKEN
|
|
|
|
file: dist/lbrynet-${OS}.zip
|
|
|
|
skip_cleanup: true
|
|
|
|
overwrite: true
|
|
|
|
draft: true
|
2018-12-12 00:10:39 -05:00
|
|
|
on:
|
|
|
|
tags: true
|
2018-07-26 18:08:26 -04:00
|
|
|
addons:
|
|
|
|
artifacts:
|
|
|
|
working_dir: dist
|
|
|
|
paths:
|
2018-09-26 17:20:24 -04:00
|
|
|
- lbrynet-${OS}.zip
|
2018-07-27 16:59:49 -04:00
|
|
|
# artifact uploader thinks lbrynet is a directory, https://github.com/travis-ci/artifacts/issues/78
|
2018-07-26 18:08:26 -04:00
|
|
|
target_paths:
|
2018-12-08 14:45:53 -05:00
|
|
|
- /daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})
|
2018-07-29 00:16:57 -04:00
|
|
|
|
|
|
|
- <<: *build
|
|
|
|
name: "Mac"
|
|
|
|
os: osx
|
2018-12-08 14:38:35 -05:00
|
|
|
osx_image: xcode8.3
|
2018-07-29 00:16:57 -04:00
|
|
|
language: generic
|
|
|
|
env: OS=mac
|
2018-11-26 20:17:01 -05:00
|
|
|
cache: false
|
2018-12-04 15:04:57 +05:30
|
|
|
before_install:
|
2019-01-10 18:44:42 -05:00
|
|
|
- brew upgrade python || true
|
|
|
|
- brew upgrade python || true
|
2018-12-04 15:04:57 +05:30
|
|
|
install:
|
|
|
|
- python3 --version
|
|
|
|
- pip3 --version
|
|
|
|
- pip3 install pyinstaller
|
2018-11-20 18:21:53 -05:00
|
|
|
- git clone https://github.com/lbryio/torba.git --depth 1
|
|
|
|
- sed -i -e "s/'plyvel',//" torba/setup.py
|
2018-12-04 15:04:57 +05:30
|
|
|
- cd torba && pip3 install -e . && cd ..
|
|
|
|
- python3 scripts/set_build.py
|
|
|
|
- pip3 install -e .
|
2018-07-24 03:06:53 -04:00
|
|
|
|
2019-01-23 17:10:32 -03:00
|
|
|
- if: tag IS present
|
2019-01-25 17:28:06 -05:00
|
|
|
stage: build
|
2019-01-25 14:03:39 -03:00
|
|
|
name: "Wallet Server Docker Image - Tagged Release"
|
2019-01-23 17:10:32 -03:00
|
|
|
script:
|
|
|
|
- set -e
|
|
|
|
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
|
|
|
|
- travis_retry docker build -t lbry/wallet-server:$TRAVIS_TAG -f scripts/Dockerfile.wallet_server .
|
|
|
|
- docker push lbry/wallet-server:$TRAVIS_TAG
|
2019-01-25 14:03:39 -03:00
|
|
|
- if: tag IS blank AND branch = master
|
2019-01-25 17:28:06 -05:00
|
|
|
stage: build
|
2019-01-25 14:03:39 -03:00
|
|
|
name: "Wallet Server Docker Image - Master"
|
|
|
|
script:
|
|
|
|
- set -e
|
|
|
|
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
|
|
|
|
- travis_retry docker build -t lbry/wallet-server:master -f scripts/Dockerfile.wallet_server .
|
|
|
|
- docker push lbry/wallet-server:master
|
2019-01-23 17:10:32 -03:00
|
|
|
|
2018-07-06 18:31:35 -04:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.cache/pip
|
|
|
|
- $HOME/Library/Caches/pip
|
|
|
|
- $TRAVIS_BUILD_DIR/.tox
|