From 8a6f8b58757bc42c5e92e47f7ba2e00e493adc43 Mon Sep 17 00:00:00 2001 From: Fergus Molloy Date: Mon, 28 Jul 2025 01:01:08 +0100 Subject: [PATCH] add database service to backend test --- .gitea/workflows/backend.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitea/workflows/backend.yaml b/.gitea/workflows/backend.yaml index 8177b32..4e5c2fe 100644 --- a/.gitea/workflows/backend.yaml +++ b/.gitea/workflows/backend.yaml @@ -41,6 +41,20 @@ jobs: run: cargo build --release --locked test: + services: + db: + image: postgres:17-alpine + ports: + - "5432:5432" + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DATABASE: nuchat_test + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 runs-on: rust-nextest defaults: run: @@ -59,6 +73,8 @@ jobs: run: cargo build --locked --bin nuchat - name: Run Tests run: ./scripts/test.sh + env: + POSTGRES_URL: "postgresql://postgres:postgres@postgres:5432" - name: Upload Test Logs if: ${{ failure() }} uses: actions/upload-artifact@v3