lnbits-legend/.github/workflows/tests.yml

59 lines
1.3 KiB
YAML
Raw Normal View History

2020-09-03 23:02:15 +02:00
name: tests
2020-04-28 23:09:59 +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
db-url:
default: ""
type: string
db-name:
default: "lnbits"
type: string
2020-04-28 23:09:59 +02:00
jobs:
tests:
runs-on: ${{ inputs.os-version }}
2022-07-28 11:23:03 +01:00
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: lnbits
POSTGRES_PASSWORD: lnbits
POSTGRES_DB: ${{ inputs.db-name }}
2022-07-28 11:23:03 +01:00
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
2022-07-28 11:23:03 +01:00
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
with:
python-version: ${{ inputs.python-version }}
- name: Run Tests
2022-07-28 11:23:03 +01:00
env:
LNBITS_DATABASE_URL: ${{ inputs.db-url }}
LNBITS_BACKEND_WALLET_CLASS: FakeWallet
run: make ${{ inputs.make }}
2022-07-28 11:23:03 +01:00
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml