Skip to content
44 changes: 44 additions & 0 deletions .github/workflows/postgres-memory-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Postgres memory store tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
postgres-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: distill_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d distill_test"
--health-interval 5s --health-timeout 5s --health-retries 5

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'

- name: Wait for Postgres
run: |
for i in {1..10}; do
pg_isready -h localhost -p 5432 -U postgres && break || sleep 2
done

- name: Run tests (with Postgres DSN)
env:
POSTGRES_DSN: postgres://postgres:postgres@localhost:5432/distill_test?sslmode=disable
run: |
go test -tags=postgres ./... -v

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will pass vacuously right now — there are no *_test.go files with the postgres build tag yet, so go test -tags=postgres ./... runs zero postgres-specific tests and exits 0.

That's fine for a draft, but worth noting: the CI green light here doesn't mean the implementation is tested. Tests need to land before this workflow is meaningful.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siddhant-K-code The postgres_test.go ( ref ) is present with the postgres tag, go running the tag will run the required test suite for postgres package.