mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-26 07:31:22 +01:00
57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
name: tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
make:
|
|
default: test
|
|
type: string
|
|
python-version:
|
|
default: "3.9"
|
|
type: string
|
|
os-version:
|
|
default: "ubuntu-latest"
|
|
type: string
|
|
db-url:
|
|
default: ""
|
|
type: string
|
|
db-name:
|
|
default: "lnbits"
|
|
type: string
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ${{ inputs.os-version }}
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:latest
|
|
env:
|
|
POSTGRES_USER: lnbits
|
|
POSTGRES_PASSWORD: lnbits
|
|
POSTGRES_DB: ${{ inputs.db-name }}
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ./.github/actions/prepare
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
- name: Run Tests
|
|
env:
|
|
LNBITS_DATABASE_URL: ${{ inputs.db-url }}
|
|
LNBITS_BACKEND_WALLET_CLASS: FakeWallet
|
|
run: make ${{ inputs.make }}
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|