97 lines
3.3 KiB
YAML
97 lines
3.3 KiB
YAML
name: regtest
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
LndRestWallet:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.7]
|
|
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: |
|
|
docker build -t lnbits-legend .
|
|
git clone https://github.com/lnbits/legend-regtest-enviroment.git docker
|
|
cd docker
|
|
source docker-scripts.sh
|
|
lnbits-regtest-start
|
|
echo "sleeping 60 seconds"
|
|
sleep 60
|
|
echo "continue"
|
|
lnbits-regtest-init
|
|
bitcoin-cli-sim -generate 1
|
|
lncli-sim 1 listpeers
|
|
sudo chmod -R a+rwx .
|
|
- 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 pylightning
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
|
- name: Run tests
|
|
env:
|
|
PYTHONUNBUFFERED: 1
|
|
PORT: 5123
|
|
LNBITS_DATA_FOLDER: ./data
|
|
LNBITS_BACKEND_WALLET_CLASS: LndRestWallet
|
|
LND_REST_ENDPOINT: https://localhost:8081/
|
|
LND_REST_CERT: docker/data/lnd-1/tls.cert
|
|
LND_REST_MACAROON: docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon
|
|
run: |
|
|
sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data
|
|
make test-real-wallet
|
|
CLightningWallet:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.7]
|
|
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: |
|
|
docker build -t lnbits-legend .
|
|
git clone https://github.com/lnbits/legend-regtest-enviroment.git docker
|
|
cd docker
|
|
source docker-scripts.sh
|
|
lnbits-regtest-start
|
|
echo "sleeping 60 seconds"
|
|
sleep 60
|
|
echo "continue"
|
|
lnbits-regtest-init
|
|
bitcoin-cli-sim -generate 1
|
|
lncli-sim 1 listpeers
|
|
sudo chmod -R a+rwx .
|
|
- 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 pylightning
|
|
./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock
|
|
- name: Run tests
|
|
env:
|
|
PYTHONUNBUFFERED: 1
|
|
PORT: 5123
|
|
LNBITS_DATA_FOLDER: ./data
|
|
LNBITS_BACKEND_WALLET_CLASS: CLightningWallet
|
|
CLIGHTNING_RPC: docker/data/clightning-1/regtest/lightning-rpc
|
|
run: |
|
|
sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data
|
|
make test-real-wallet |