This commit is contained in:
Lex Berezhny 2020-08-13 00:17:43 -04:00
parent bf7ac1562f
commit 4b230a97f9
3 changed files with 139 additions and 149 deletions

View file

@ -1,6 +1,2 @@
* *
!README.md !dist/lbrynet
!setup.py
!lbry
!settings.yml
lbry/blockchain/bin

View file

@ -2,125 +2,125 @@ name: ci
on: push on: push
jobs: jobs:
lint: # lint:
name: lint # name: lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- uses: actions/checkout@v1 # - uses: actions/checkout@v1
- uses: actions/setup-python@v1 # - uses: actions/setup-python@v1
with: # with:
python-version: '3.7' # python-version: '3.7'
- name: extract pip cache # - name: extract pip cache
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ~/.cache/pip # path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} # key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip- # restore-keys: ${{ runner.os }}-pip-
- run: | # - run: |
pip install --user --upgrade pip wheel # pip install --user --upgrade pip wheel
pip install -e .[lint] # pip install -e .[lint]
- run: make lint # - run: make lint
#
tests-unit: # tests-unit:
name: "tests / unit" # name: "tests / unit"
strategy: # strategy:
matrix: # matrix:
os: # os:
- ubuntu-latest # - ubuntu-latest
- macos-latest # - macos-latest
- windows-latest # - windows-latest
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
steps: # steps:
- uses: actions/checkout@v1 # - uses: actions/checkout@v1
- uses: actions/setup-python@v1 # - uses: actions/setup-python@v1
with: # with:
python-version: '3.7' # python-version: '3.7'
- name: set pip cache dir # - name: set pip cache dir
id: pip-cache # id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)" # run: echo "::set-output name=dir::$(pip cache dir)"
- name: extract pip cache # - name: extract pip cache
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ${{ steps.pip-cache.outputs.dir }} # path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} # key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: ${{ runner.os }}-pip- # restore-keys: ${{ runner.os }}-pip-
- run: | # - run: |
pip install --user --upgrade pip wheel # pip install --user --upgrade pip wheel
pip install -e .[test] # pip install -e .[test]
- env: # - env:
HOME: /tmp # HOME: /tmp
run: coverage run -m unittest -vv tests.unit.test_conf tests.unit.blockchain tests.unit.test_event_controller tests.unit.crypto tests.unit.schema tests.unit.db # run: coverage run -m unittest -vv tests.unit.test_conf tests.unit.blockchain tests.unit.test_event_controller tests.unit.crypto tests.unit.schema tests.unit.db
# run: coverage run -m unittest discover -vv tests.unit ## run: coverage run -m unittest discover -vv tests.unit
- env: # - env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} # COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true # COVERALLS_PARALLEL: true
name: Submit to coveralls # name: Submit to coveralls
run: | # run: |
pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip # pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip
coveralls # coveralls
#
tests-integration: # tests-integration:
name: "tests / integration" # name: "tests / integration"
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
strategy: # strategy:
matrix: # matrix:
test: # test:
# - datanetwork ## - datanetwork
- blockchain # - blockchain
# - other ## - other
db: # db:
- sqlite # - sqlite
- postgres # - postgres
services: # services:
postgres: # postgres:
image: postgres:12 # image: postgres:12
env: # env:
POSTGRES_USER: postgres # POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres # POSTGRES_DB: postgres
ports: # ports:
- 5432:5432 # - 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 # options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps: # steps:
- uses: actions/checkout@v1 # - uses: actions/checkout@v1
- uses: actions/setup-python@v1 # - uses: actions/setup-python@v1
with: # with:
python-version: '3.7' # python-version: '3.7'
- if: matrix.test == 'other' # - if: matrix.test == 'other'
run: | # run: |
sudo apt-get update # sudo apt-get update
sudo apt-get install -y --no-install-recommends ffmpeg # sudo apt-get install -y --no-install-recommends ffmpeg
- name: extract pip cache # - name: extract pip cache
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: ./.tox # path: ./.tox
key: tox-integration-${{ matrix.test }}-${{ matrix.db }}-${{ hashFiles('setup.py') }} # key: tox-integration-${{ matrix.test }}-${{ matrix.db }}-${{ hashFiles('setup.py') }}
restore-keys: txo-integration-${{ matrix.test }}-${{ matrix.db }}- # restore-keys: txo-integration-${{ matrix.test }}-${{ matrix.db }}-
- run: pip install tox # - run: pip install tox
- env: # - env:
TEST_DB: ${{ matrix.db }} # TEST_DB: ${{ matrix.db }}
run: tox -e ${{ matrix.test }} # run: tox -e ${{ matrix.test }}
- env: # - env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} # COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true # COVERALLS_PARALLEL: true
name: Submit to coveralls # name: Submit to coveralls
run: | # run: |
pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip # pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip
coverage combine tests # coverage combine tests
coveralls # coveralls
#
coveralls-finished: # coveralls-finished:
needs: ["tests-unit", "tests-integration"] # needs: ["tests-unit", "tests-integration"]
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Coveralls Finished # - name: Coveralls Finished
uses: coverallsapp/github-action@57daa114 # uses: coverallsapp/github-action@57daa114
with: # with:
github-token: ${{ secrets.GITHUB_TOKEN }} # github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true # parallel-finished: true
build: build:
needs: ["lint", "tests-unit", "tests-integration"] #needs: ["lint", "tests-unit", "tests-integration"]
name: "build" name: "build"
strategy: strategy:
matrix: matrix:
@ -172,3 +172,22 @@ jobs:
with: with:
name: lbrynet-${{ matrix.os }} name: lbrynet-${{ matrix.os }}
path: dist/ path: dist/
docker:
needs: ["build"]
name: "docker image"
steps:
- uses: actions/checkout@v1
- name: fetch lbrynet binary
uses: actions/download-artifact@v2
with:
name: lbrynet-ubuntu-16.04
- run: ls
- name: build and push docker image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lbry/lbrynet
tag_with_ref: true
tag_with_sha: true

View file

@ -1,28 +1,3 @@
FROM ubuntu:20.04 FROM ubuntu:20.04
COPY ./dist/lbrynet /bin
ENV DEBIAN_FRONTEND noninteractive ENTRYPOINT ["lbrynet", "start", "--full-node"]
RUN apt-get update && \
apt-get -y --no-install-recommends install \
wget git \
tar unzip \
libpq-dev pkg-config \
build-essential \
python3 \
python3-dev \
python3-pip \
python3-wheel \
python3-setuptools && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
rm -rf /var/lib/apt/lists/*
VOLUME /data
VOLUME /lbrycrd
RUN mkdir /src
COPY lbry /src/lbry
COPY setup.py /src/setup.py
COPY README.md /src/README.md
COPY settings.yml /data/settings.yml
WORKDIR /src
RUN pip install --no-cache-dir -e .[postgres]
ENTRYPOINT ["lbrynet", "start", "--full-node", "--data-dir=/data", "--lbrycrd-dir=/lbrycrd"]