forked from LBRYCommunity/lbry-sdk
6c75a8978b
implemented fix recommended by: https://stackoverflow.com/a/61693590 https://github.com/pypa/setuptools/issues/1963
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: ci
|
|
on: pull_request
|
|
jobs:
|
|
|
|
lint:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: '3.7'
|
|
- run: make install tools
|
|
- run: make lint
|
|
|
|
tests-unit:
|
|
name: "tests / unit"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: '3.7'
|
|
- run: make install tools
|
|
- working-directory: lbry
|
|
env:
|
|
HOME: /tmp
|
|
run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
|
|
|
|
tests-integration:
|
|
name: "tests / integration"
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
test:
|
|
- datanetwork
|
|
- blockchain
|
|
- other
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: '3.7'
|
|
- if: matrix.test == 'other'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends ffmpeg
|
|
- run: pip install tox-travis
|
|
- run: tox -e ${{ matrix.test }}
|
|
|
|
build:
|
|
needs: ["lint", "tests-unit", "tests-integration"]
|
|
name: "build"
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: '3.7'
|
|
- name: Setup
|
|
run: |
|
|
pip install pyinstaller
|
|
pip install -e .
|
|
# https://stackoverflow.com/a/61693590
|
|
# https://github.com/pypa/setuptools/issues/1963
|
|
pip install --upgrade 'setuptools<45.0.0'
|
|
- if: startsWith(matrix.os, 'windows') == false
|
|
name: Build & Run (Unix)
|
|
run: |
|
|
pyinstaller --onefile --name lbrynet lbry/extras/cli.py
|
|
chmod +x dist/lbrynet
|
|
dist/lbrynet --version
|
|
- if: startsWith(matrix.os, 'windows')
|
|
name: Build & Run (Windows)
|
|
run: |
|
|
pip install pywin32
|
|
pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico --onefile --name lbrynet lbry/extras/cli.py
|
|
dist/lbrynet.exe --version
|