mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 15:44:21 +00:00
Add PostgreSQL service to GitHub Actions workflow for integration tests
This commit is contained in:
17
.github/workflows/go-test.yml
vendored
17
.github/workflows/go-test.yml
vendored
@@ -13,6 +13,21 @@ jobs:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: lemma_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./server
|
||||
@@ -29,6 +44,8 @@ jobs:
|
||||
|
||||
- name: Run Tests
|
||||
run: go test -tags=test,integration ./... -v
|
||||
env:
|
||||
LEMMA_TEST_POSTGRES_URL: "postgres://postgres:postgres@localhost:5432/lemma_test?sslmode=disable"
|
||||
|
||||
- name: Run Tests with Race Detector
|
||||
run: go test -tags=test,integration -race ./... -v
|
||||
|
||||
Reference in New Issue
Block a user