diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..fab46fcf4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,79 @@ +name: ci +on: pull_request +jobs: + + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - 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@v1 + - 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@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.7' + - if: matrix.test == 'other' + run: sudo apt 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@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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f9d2be2c..02652a791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,14 +46,14 @@ test:datanetwork-integration: test:blockchain-integration: stage: test script: - - apt-get update - - apt-get install -y --no-install-recommends ffmpeg - pip install tox-travis - tox -e blockchain test:other-integration: stage: test script: + - apt-get update + - apt-get install -y --no-install-recommends ffmpeg - pip install tox-travis - tox -e other diff --git a/tests/integration/blockchain/test_transcoding.py b/tests/integration/other/test_transcoding.py similarity index 99% rename from tests/integration/blockchain/test_transcoding.py rename to tests/integration/other/test_transcoding.py index 47fe511c7..c832ec4ec 100644 --- a/tests/integration/blockchain/test_transcoding.py +++ b/tests/integration/other/test_transcoding.py @@ -2,7 +2,7 @@ import logging import pathlib import time -from .test_claim_commands import ClaimTestCase +from ..blockchain.test_claim_commands import ClaimTestCase from lbry.conf import TranscodeConfig from lbry.file_analysis import VideoFileAnalyzer