add database service to backend test
Some checks failed
Backend Actions / check (push) Failing after 2m15s
Backend Actions / build (push) Failing after 3m15s
Backend Actions / test (push) Failing after 3m22s
Frontend Actions / check (push) Successful in 1m16s
Frontend Actions / build (push) Has been cancelled
Frontend Actions / test (push) Has been cancelled

This commit is contained in:
2025-07-28 01:01:08 +01:00
parent 79e43f19df
commit 8a6f8b5875

View File

@ -41,6 +41,20 @@ jobs:
run: cargo build --release --locked run: cargo build --release --locked
test: 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 runs-on: rust-nextest
defaults: defaults:
run: run:
@ -59,6 +73,8 @@ jobs:
run: cargo build --locked --bin nuchat run: cargo build --locked --bin nuchat
- name: Run Tests - name: Run Tests
run: ./scripts/test.sh run: ./scripts/test.sh
env:
POSTGRES_URL: "postgresql://postgres:postgres@postgres:5432"
- name: Upload Test Logs - name: Upload Test Logs
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3