Test: Coordinator #129
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 | |
timeout-minutes: 30 | |
strategy: | |
max-parallel: 2 | |
matrix: | |
python-tag: ['3.12.3-slim-bookworm'] | |
lnd-version: ['v0.18.2-beta'] | |
cln-version: ['v24.08'] | |
ln-vendor: ['LND', 'CLN'] | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- name: 'Download static files Artifact' | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: frontend-build.yml | |
workflow_conclusion: success | |
name: django-main-static | |
path: frontend | |
- name: Patch Dockerfile and .env-sample | |
run: | | |
sed -i "1s/FROM python:.*/FROM python:${{ matrix.python-tag }}/" Dockerfile | |
sed -i "s/^LNVENDOR=.*/LNVENDOR='${{ matrix.ln-vendor }}'/" .env-sample | |
- uses: satackey/[email protected] | |
continue-on-error: true | |
with: | |
key: coordinator-docker-cache-${{ hashFiles('Dockerfile', 'requirements.txt', 'requirements_dev.txt') }}-${{ matrix.ln-vendor }} | |
restore-keys: | | |
coordinator-docker-cache- | |
- 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 | |
coordinator | |
env: | |
LND_VERSION: ${{ matrix.lnd-version }} | |
CLN_VERSION: ${{ matrix.cln-version }} | |
ROBOSATS_ENVS_FILE: ".env-sample" | |
- name: Wait for coordinator (django server) | |
run: | | |
while [ "$(docker inspect --format "{{.State.Health.Status}}" test-coordinator)" != "healthy" ]; do | |
echo "Waiting for coordinator to be healthy..." | |
sleep 5 | |
done | |
- name: 'Run tests with coverage' | |
run: | | |
docker exec test-coordinator coverage run manage.py test | |
docker exec test-coordinator coverage report | |
docker exec test-coordinator coverage html | |
env: | |
LNVENDOR: ${{ matrix.ln-vendor }} | |
DEVELOPMENT: True | |
USE_TOR: False | |
- name: 'Upload coverage report' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-${{ matrix.python-tag }}-${{ matrix.ln-vendor }}-${{ github.run_id }} | |
path: htmlcov/ |