Test: Coordinator #56
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test: Coordinator" | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: [ "main" ] | |
paths: ["api", "chat", "control", "robosats"] | |
pull_request_target: | |
branches: [ "main" ] | |
paths: ["api", "chat", "control", "robosats"] | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
python-version: ["3.11.6", "3.12"] | |
lnd-version: ["v0.17.0-beta", "v0.17.0-beta.rc1"] | |
cln-version: ["v23.08.1"] | |
ln-vendor: ["LND", "CLN"] | |
bitcoind-version: ["24.0.1"] | |
include: | |
- lnd-version: "v0.17.0-beta" | |
ln-vendor: "LND" | |
- lnd-version: "v0.17.1-beta.rc1" | |
ln-vendor: "LND" | |
- cln-version: "v23.08.1" | |
ln-vendor: "CLN" | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- name: 'Compose Regtest Orchestration' | |
uses: isbang/[email protected] | |
with: | |
compose-file: "./docker-tests.yml" | |
down-flags: "--volumes" | |
services: | | |
bitcoind | |
postgres | |
redis | |
coordinator-${{ matrix.ln-vendor }} | |
robot-LND | |
env: | |
LND_VERSION: ${{ matrix.lnd-version }} | |
CLN_VERSION: ${{ matrix.cln-version }} | |
BITCOIND_VERSION: ${{ matrix.bitcoind-version }} | |
ROBOSATS_ENVS_FILE: ".env-sample" | |
- name: 'Set up Python ${{ matrix.python-version }}' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
# - name: 'Cache pip dependencies' | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.cache/pip | |
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-pip-dev-${{ hashFiles('**/requirements_dev.txt') }} | |
# restore-keys: | | |
# ${{ runner.os }}-pip- | |
- name: 'Install Python Dependencies' | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements_dev.txt | |
- name: 'Install LND/CLN gRPC Dependencies' | |
run: bash ./scripts/generate_grpc.sh | |
- name: 'Create .env File' | |
run: mv .env-sample .env | |
- name: 'Copy credentials' | |
run: | | |
mkdir -p /lndrobot/data/chain/bitcoin/regtest | |
sudo cp /var/lib/docker/volumes/robosats_lndrobot/_data/tls.cert /lnd/tls.cert | |
sudo cp /var/lib/docker/volumes/robosats_lndrobot/_data/data/chain/bitcoin/regtest/admin.macaroon /lndrobot/data/chain/bitcoin/regtest/admin.macaroon | |
sudo chmod -R 777 /lndrobot/tls.cert | |
sudo chmod -R 777 /lndrobot/data/chain/bitcoin/regtest/admin.macaroon | |
if [ "${{ matrix.ln-vendor }}" = "LND" ]; then | |
mkdir -p /lnd/data/chain/bitcoin/regtest | |
sudo cp /var/lib/docker/volumes/robosats_lnd/_data/tls.cert /lnd/tls.cert | |
sudo cp /var/lib/docker/volumes/robosats_lnd/_data/data/chain/bitcoin/regtest/admin.macaroon /lnd/data/chain/bitcoin/regtest/admin.macaroon | |
sudo chmod -R 777 /lnd/tls.cert | |
sudo chmod -R 777 /lnd/data/chain/bitcoin/regtest/admin.macaroon | |
elif [ "${{ matrix.ln-vendor }}" = "CLN" ]; then | |
mkdir -p /cln/regtest | |
sudo find /var/lib/docker/volumes/robosats_cln/_data/regtest/ -type f -name "*.pem" -exec cp {} /cln/regtest/ \; | |
fi | |
- name: 'Run tests with coverage' | |
run: | | |
coverage run manage.py test | |
coverage report | |
env: | |
LNVENDOR: ${{ matrix.ln-vendor }} | |
DEVELOPMENT: True | |
USE_TOR: False | |
MACAROON_PATH: 'data/chain/bitcoin/regtest/admin.macaroon' | |
CLN_DIR: '/cln/regtest/' |