mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 15:44:21 +00:00
57 lines
1.1 KiB
YAML
57 lines
1.1 KiB
YAML
name: Go Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
paths:
|
|
- "server/**"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
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
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
cache: true
|
|
|
|
- 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
|