github actions

This commit is contained in:
Lex Berezhny 2020-06-03 19:45:10 -04:00
parent a042377a7b
commit 8799caa0e4

View file

@ -1,38 +1,51 @@
name: ci
on: pull_request
#on: pull_request
on: push
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- run: pip install -e .[lint]
- run: make lint
# lint:
# name: lint
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: actions/setup-python@v1
# with:
# python-version: '3.7'
# - run: pip install -e .[lint]
# - run: make lint
tests-unit:
name: "tests / unit"
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- run: pip install -e .[test]
- working-directory: lbry
env:
HOME: /tmp
run: coverage run -p --source=lbry -m unittest -vv tests.unit.test_conf
#run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
# tests-unit:
# name: "tests / unit"
# strategy:
# matrix:
# os:
# - ubuntu-latest
# - macos-latest
# - windows-latest
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v1
# - uses: actions/setup-python@v1
# with:
# python-version: '3.7'
# - name: set pip cache dir
# id: pip-cache
# run: echo "::set-output name=dir::$(pip cache dir)"
# - name: extract pip cache
# uses: actions/cache@v2
# with:
# path: ${{ steps.pip-cache.outputs.dir }}
# key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
# restore-keys: ${{ runner.os }}-pip-
# - run: |
# pip install --user --upgrade pip wheel
# pip install -e .[test]
# - working-directory: lbry
# env:
# HOME: /tmp
# run: coverage run -p --source=lbry -m unittest -vv tests.unit.test_conf
#- run: coverage run -p --source=lbry -m unittest discover -vv tests.unit
# tests-integration:
# name: "tests / integration"
@ -70,34 +83,53 @@ jobs:
# TEST_DB: ${{ matrix.db }}
# 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@v1
# - uses: actions/setup-python@v1
# with:
# python-version: '3.7'
# - name: Setup
# run: |
# pip install pyinstaller
# pip install -e .
# - 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
build:
#needs: ["lint", "tests-unit", "tests-integration"]
#needs: ["tests-unit"]
name: "build"
strategy:
matrix:
os:
- ubuntu-16.04
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: set pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: extract pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip-
- if: startsWith(runner.os, 'linux')
run: sudo apt-get install libzmq3-dev
- if: startsWith(runner.os, 'mac')
run: brew install zeromq
- name: Setup
run: |
pip install --user --upgrade pip wheel
pip install sqlalchemy@git+https://github.com/eukreign/pyinstaller.git@sqlalchemy
pip install -e .
- if: startsWith(runner.os, 'linux') || startsWith(runner.os, 'mac')
name: Build & Run (Unix)
run: |
pyinstaller --onefile --name lbrynet lbry/cli.py
chmod +x dist/lbrynet
dist/lbrynet --version
- if: startsWith(runner.os, 'windows')
name: Build & Run (Windows)
run: |
pip install pywin32
pyinstaller --additional-hooks-dir=scripts/. --icon=icons/lbry256.ico --onefile --name lbrynet lbry/cli.py
dist/lbrynet.exe --version
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}
path: dist/