lbry-sdk/.travis.yml

129 lines
4 KiB
YAML
Raw Normal View History

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-02-28 12:04:02 -05:00
- pip install astroid pylint
- 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
- 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
- pip install git+https://github.com/lbryio/torba.git#egg=torba
2019-01-23 18:22:10 -05:00
- pip install -e .
script:
- HOME=/tmp coverage run -p --source=lbrynet -m unittest discover -vv tests.unit
2018-07-27 17:56:13 -04:00
after_success:
- coverage combine
2018-07-27 17:56:13 -04:00
- bash <(curl -s https://codecov.io/bash)
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)
- stage: build
2018-07-26 19:18:48 -04:00
name: "Windows"
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
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:
- /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"
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 .
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
- ./dist/lbrynet --version
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
# 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:
- /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
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
before_install:
- brew upgrade python || true
- brew upgrade python || true
- if: tag IS present
stage: build
name: "Wallet Server Docker Image - Tagged Release"
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-03-18 20:32:09 -03:00
- if: tag IS blank AND branch = master AND NOT type IN (pull_request)
stage: build
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
2018-07-06 18:31:35 -04:00
cache:
directories:
- $HOME/.cache/pip
- $HOME/Library/Caches/pip
- $TRAVIS_BUILD_DIR/.tox