2022-07-16 14:10:43 +02:00
|
|
|
name: regtest
|
|
|
|
|
2023-08-24 12:36:37 +02:00
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
make:
|
|
|
|
default: test
|
|
|
|
type: string
|
|
|
|
python-version:
|
|
|
|
default: "3.9"
|
|
|
|
type: string
|
|
|
|
os-version:
|
|
|
|
default: "ubuntu-latest"
|
|
|
|
type: string
|
|
|
|
backend-wallet-class:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-07-16 14:10:43 +02:00
|
|
|
|
|
|
|
jobs:
|
2023-08-24 12:36:37 +02:00
|
|
|
regtest:
|
|
|
|
runs-on: ${{ inputs.os-version }}
|
2023-08-30 12:01:32 +02:00
|
|
|
timeout-minutes: 10
|
2022-07-16 14:10:43 +02:00
|
|
|
steps:
|
2023-01-29 11:46:20 +01:00
|
|
|
- uses: actions/checkout@v3
|
2023-08-24 12:36:37 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
if: ${{ inputs.backend-wallet-class == 'LNbitsWallet' }}
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
if: ${{ inputs.backend-wallet-class == 'LNbitsWallet' }}
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: false
|
|
|
|
tags: lnbitsdocker/lnbits-legend:latest
|
|
|
|
cache-from: type=registry,ref=lnbitsdocker/lnbits-legend:latest
|
|
|
|
cache-to: type=inline
|
|
|
|
|
2022-07-16 14:10:43 +02:00
|
|
|
- name: Setup Regtest
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/lnbits/legend-regtest-enviroment.git docker
|
|
|
|
cd docker
|
2022-07-25 07:31:15 +02:00
|
|
|
chmod +x ./tests
|
|
|
|
./tests
|
2022-07-16 14:10:43 +02:00
|
|
|
sudo chmod -R a+rwx .
|
2023-08-24 12:36:37 +02:00
|
|
|
|
|
|
|
- uses: ./.github/actions/prepare
|
|
|
|
with:
|
|
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
|
|
|
|
- name: Create fake admin
|
|
|
|
if: ${{ inputs.backend-wallet-class == 'LNbitsWallet' }}
|
|
|
|
run: docker exec lnbits-legend-lnbits-1 poetry run python tools/create_fake_admin.py
|
|
|
|
|
|
|
|
- name: Run Tests
|
2022-07-16 14:10:43 +02:00
|
|
|
env:
|
2023-08-24 12:36:37 +02:00
|
|
|
LNBITS_DATABASE_URL: ${{ inputs.db-url }}
|
|
|
|
LNBITS_BACKEND_WALLET_CLASS: ${{ inputs.backend-wallet-class }}
|
2022-07-16 14:10:43 +02:00
|
|
|
LND_REST_ENDPOINT: https://localhost:8081/
|
2023-06-15 12:36:28 +02:00
|
|
|
LND_REST_CERT: ./docker/data/lnd-3/tls.cert
|
|
|
|
LND_REST_MACAROON: ./docker/data/lnd-3/data/chain/bitcoin/regtest/admin.macaroon
|
2022-08-09 11:49:39 +02:00
|
|
|
LND_GRPC_ENDPOINT: localhost
|
|
|
|
LND_GRPC_PORT: 10009
|
2023-06-15 12:36:28 +02:00
|
|
|
LND_GRPC_CERT: docker/data/lnd-3/tls.cert
|
|
|
|
LND_GRPC_MACAROON: docker/data/lnd-3/data/chain/bitcoin/regtest/admin.macaroon
|
2022-08-01 16:41:50 +02:00
|
|
|
CORELIGHTNING_RPC: ./docker/data/clightning-1/regtest/lightning-rpc
|
2023-08-23 08:59:39 +02:00
|
|
|
CORELIGHTNING_REST_URL: https://localhost:3001
|
|
|
|
CORELIGHTNING_REST_MACAROON: ./docker/data/clightning-2-rest/access.macaroon
|
|
|
|
CORELIGHTNING_REST_CERT: ./docker/data/clightning-2-rest/certificate.pem
|
2023-01-26 10:43:12 +01:00
|
|
|
LNBITS_ENDPOINT: http://localhost:5001
|
|
|
|
LNBITS_KEY: "d08a3313322a4514af75d488bcc27eee"
|
2023-01-25 15:07:41 +01:00
|
|
|
ECLAIR_URL: http://127.0.0.1:8082
|
|
|
|
ECLAIR_PASS: lnbits
|
2023-08-24 12:36:37 +02:00
|
|
|
run: make test-real-wallet
|
|
|
|
|
2023-01-25 15:07:41 +01:00
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
2023-08-28 13:49:33 +02:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2023-01-29 11:46:20 +01:00
|
|
|
file: ./coverage.xml
|