Skip to content

Commit

Permalink
start postgres only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Feb 11, 2024
1 parent c2c72b6 commit 6ddf019
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
poetry-version: ["1.7.1"]
mint-cache-secrets: ["false", "true"]
mint-only-deprecated: ["false", "true"]
db-url: ["", "postgres://cashu:cashu@localhost:5432/cashu"] # TODO: Postgres test not working
# db-url: [""]
mint-database: ["", "postgres://cashu:cashu@localhost:5432/cashu"]
# mint-database: [""]
backend-wallet-class: ["FakeWallet"]
uses: ./.github/workflows/tests.yml
with:
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/regtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
os-version:
default: "ubuntu-latest"
type: string
db-url:
mint-database:
default: ""
type: string
backend-wallet-class:
Expand All @@ -23,6 +23,21 @@ jobs:
regtest:
runs-on: ${{ inputs.os-version }}
timeout-minutes: 10
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
if: startsWith(inputs.mint-database, 'postgres')
steps:
- uses: actions/checkout@v3

Expand All @@ -47,7 +62,7 @@ jobs:
WALLET_NAME: test_wallet
MINT_HOST: localhost
MINT_PORT: 3337
MINT_DATABASE: ${{ inputs.db-url }}
MINT_DATABASE: ${{ inputs.mint-database }}
TOR: false
MINT_LIGHTNING_BACKEND: ${{ inputs.backend-wallet-class }}
MINT_LNBITS_ENDPOINT: http://localhost:5001
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
poetry-version:
default: "1.7.1"
type: string
db-url:
mint-database:
default: ""
type: string
os:
Expand Down Expand Up @@ -40,6 +40,7 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
if: startsWith(inputs.mint-database, 'postgres')
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
Expand All @@ -53,7 +54,7 @@ jobs:
WALLET_NAME: test_wallet
MINT_HOST: localhost
MINT_PORT: 3337
MINT_DATABASE: ${{ inputs.db-url }}
MINT_DATABASE: ${{ inputs.mint-database }}
MINT_CACHE_SECRETS: ${{ inputs.mint-cache-secrets }}
DEBUG_MINT_ONLY_DEPRECATED: ${{ inputs.mint-only-deprecated }}
TOR: false
Expand Down

0 comments on commit 6ddf019

Please sign in to comment.