2022-07-16 12:10:43 +00:00
|
|
|
name: regtest
|
|
|
|
|
2022-07-16 12:17:45 +00:00
|
|
|
on: [push, pull_request]
|
2022-07-16 12:10:43 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
LndRestWallet:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-23 08:39:58 +00:00
|
|
|
python-version: [3.8]
|
2022-07-16 12:10:43 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Setup Regtest
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/lnbits/legend-regtest-enviroment.git docker
|
|
|
|
cd docker
|
2022-07-25 05:31:15 +00:00
|
|
|
chmod +x ./tests
|
|
|
|
./tests
|
2022-07-16 12:10:43 +00:00
|
|
|
sudo chmod -R a+rwx .
|
|
|
|
- name: Install dependencies
|
2022-07-25 05:31:15 +00:00
|
|
|
env:
|
2022-07-16 12:10:43 +00:00
|
|
|
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 pylightning
|
2022-07-25 05:31:15 +00:00
|
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
2022-07-16 12:10:43 +00:00
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
PORT: 5123
|
|
|
|
LNBITS_DATA_FOLDER: ./data
|
|
|
|
LNBITS_BACKEND_WALLET_CLASS: LndRestWallet
|
|
|
|
LND_REST_ENDPOINT: https://localhost:8081/
|
2022-07-28 09:09:03 +00:00
|
|
|
LND_REST_CERT: ./docker/data/lnd-1/tls.cert
|
|
|
|
LND_REST_MACAROON: ./docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon
|
2022-07-16 12:10:43 +00:00
|
|
|
run: |
|
|
|
|
sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data
|
|
|
|
make test-real-wallet
|
|
|
|
CLightningWallet:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-23 08:39:58 +00:00
|
|
|
python-version: [3.8]
|
2022-07-16 12:10:43 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Setup Regtest
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/lnbits/legend-regtest-enviroment.git docker
|
|
|
|
cd docker
|
2022-07-25 05:31:15 +00:00
|
|
|
chmod +x ./tests
|
|
|
|
./tests
|
2022-07-16 12:10:43 +00:00
|
|
|
sudo chmod -R a+rwx .
|
|
|
|
- name: Install dependencies
|
2022-07-25 05:31:15 +00:00
|
|
|
env:
|
2022-07-16 12:10:43 +00:00
|
|
|
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 pylightning
|
2022-07-25 05:31:15 +00:00
|
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
2022-07-16 12:10:43 +00:00
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
PORT: 5123
|
|
|
|
LNBITS_DATA_FOLDER: ./data
|
|
|
|
LNBITS_BACKEND_WALLET_CLASS: CLightningWallet
|
2022-07-28 09:09:03 +00:00
|
|
|
CLIGHTNING_RPC: ./docker/data/clightning-1/regtest/lightning-rpc
|
2022-07-16 12:10:43 +00:00
|
|
|
run: |
|
|
|
|
sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data
|
2022-07-25 05:31:15 +00:00
|
|
|
make test-real-wallet
|