Skip to content

add GitHub Actions workflow for Postgres memory tests #3

add GitHub Actions workflow for Postgres memory tests

add GitHub Actions workflow for Postgres memory tests #3

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:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: '1.24'
- name: Run tests (with Postgres DSN)
env:
POSTGRES_DSN: postgres://postgres:postgres@localhost:5432/distill_test?sslmode=disable
run: |
go test -tags=postgres ./... -v