Files
nutshell/.github/workflows/tests.yml
callebtc f74f18c9ca Github CI with Postgres (#417)
* with postgres

* postgres test explicit

* make format

* start postgres only if needed

* remove if again

* print db

* db in matrix

* delete schema

* use new env var MINT_TEST_DATABASE for tests

* add db path to regtest
2024-02-11 15:52:02 +01:00

64 lines
1.7 KiB
YAML

name: tests
on:
workflow_call:
inputs:
python-version:
default: "3.10.4"
type: string
poetry-version:
default: "1.7.1"
type: string
mint-database:
default: ""
type: string
os:
default: "ubuntu-latest"
type: string
mint-cache-secrets:
default: "false"
type: string
mint-only-deprecated:
default: "false"
type: string
jobs:
poetry:
name: Run (mint-cache-secrets ${{ inputs.mint-cache-secrets }}, mint-only-deprecated ${{ inputs.mint-only-deprecated }}, mint-database ${{ inputs.mint-database }})
runs-on: ${{ inputs.os }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: cashu
POSTGRES_PASSWORD: cashu
POSTGRES_DB: cashu
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
- uses: ./.github/actions/prepare
with:
python-version: ${{ inputs.python-version }}
poetry-version: ${{ inputs.poetry-version }}
- name: Run tests
env:
MINT_LIGHTNING_BACKEND: FakeWallet
WALLET_NAME: test_wallet
MINT_HOST: localhost
MINT_PORT: 3337
MINT_TEST_DATABASE: ${{ inputs.mint-database }}
MINT_CACHE_SECRETS: ${{ inputs.mint-cache-secrets }}
DEBUG_MINT_ONLY_DEPRECATED: ${{ inputs.mint-only-deprecated }}
TOR: false
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3