2020-09-03 21:02:15 +00:00
|
|
|
name: tests
|
2020-04-28 21:09:59 +00:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2022-07-07 16:29:26 +00:00
|
|
|
sqlite:
|
2020-04-28 21:09:59 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-07 16:29:26 +00:00
|
|
|
python-version: [3.7, 3.8]
|
2020-04-28 21:09:59 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2022-06-26 22:11:46 +00:00
|
|
|
uses: actions/setup-python@v2
|
2020-04-28 21:09:59 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
2021-11-17 16:53:32 +00:00
|
|
|
env:
|
|
|
|
VIRTUAL_ENV: ./venv
|
|
|
|
PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }}
|
2020-04-28 21:09:59 +00:00
|
|
|
run: |
|
2021-11-17 16:53:32 +00:00
|
|
|
python -m venv ${{ env.VIRTUAL_ENV }}
|
|
|
|
./venv/bin/python -m pip install --upgrade pip
|
|
|
|
./venv/bin/pip install -r requirements.txt
|
2022-07-07 16:29:26 +00:00
|
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
2021-11-17 16:53:32 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: make test
|
2022-07-07 16:29:26 +00:00
|
|
|
postgres:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:latest
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_DB: postgres
|
|
|
|
ports:
|
|
|
|
# maps tcp port 5432 on service container to the host
|
|
|
|
- 5432:5432
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: [3.7, 3.8]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
env:
|
|
|
|
VIRTUAL_ENV: ./venv
|
|
|
|
PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }}
|
|
|
|
run: |
|
|
|
|
python -m venv ${{ env.VIRTUAL_ENV }}
|
|
|
|
./venv/bin/python -m pip install --upgrade pip
|
|
|
|
./venv/bin/pip install -r requirements.txt
|
|
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
LNBITS_DATABASE_URL: postgres://postgres:postgres@0.0.0.0:5432/postgres
|
|
|
|
run: make test
|
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
file: ./coverage.xml
|
2021-11-17 16:53:32 +00:00
|
|
|
# build:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# strategy:
|
|
|
|
# matrix:
|
|
|
|
# python-version: [3.7, 3.8]
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Set up Python ${{ matrix.python-version }}
|
|
|
|
# uses: actions/setup-python@v1
|
|
|
|
# with:
|
|
|
|
# python-version: ${{ matrix.python-version }}
|
|
|
|
# - name: Install dependencies
|
|
|
|
# run: |
|
|
|
|
# python -m pip install --upgrade pip
|
|
|
|
# pip install -r requirements.txt
|
|
|
|
# - name: Test with pytest
|
|
|
|
# env:
|
|
|
|
# LNBITS_BACKEND_WALLET_CLASS: LNPayWallet
|
|
|
|
# LNBITS_FORCE_HTTPS: 0
|
|
|
|
# LNPAY_API_ENDPOINT: https://api.lnpay.co/v1/
|
|
|
|
# LNPAY_API_KEY: sak_gG5pSFZhFgOLHm26a8hcWvXKt98yd
|
|
|
|
# LNPAY_ADMIN_KEY: waka_HqWfOoNE0TPqmQHSYErbF4n9
|
|
|
|
# LNPAY_INVOICE_KEY: waki_ZqFEbhrTyopuPlOZButZUw
|
|
|
|
# LNPAY_READ_KEY: wakr_6IyTaNrvSeu3jbojSWt4ou6h
|
|
|
|
# run: |
|
|
|
|
# pip install pytest pytest-cov
|
|
|
|
# pytest --cov=lnbits --cov-report=xml
|
|
|
|
# - name: Upload coverage to Codecov
|
|
|
|
# uses: codecov/codecov-action@v1
|
|
|
|
# with:
|
|
|
|
# file: ./coverage.xml
|