Add Gitea CI configuration and Sisyphus workspace/plan files. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
name: Backend Tests
|
||||
description: Runs Go tests with PostgreSQL for all backend packages.
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_USER: myuser
|
||||
POSTGRES_PASSWORD: mypassword
|
||||
POSTGRES_DB: mydb
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25"
|
||||
cache-dependency-path: backend/go.sum
|
||||
|
||||
- name: Install system deps
|
||||
run: sudo apt-get update && sudo apt-get install -y postgresql-client
|
||||
|
||||
- name: Wait for PostgreSQL
|
||||
run: |
|
||||
for i in $(seq 1 30); do
|
||||
pg_isready -h 127.0.0.1 -U myuser && break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
- name: Build
|
||||
working-directory: backend
|
||||
run: go build ./...
|
||||
|
||||
- name: Vet
|
||||
working-directory: backend
|
||||
run: go vet ./...
|
||||
|
||||
- name: Test (all packages)
|
||||
working-directory: backend
|
||||
run: go test -tags "test,dev" -count=1 -v -timeout 120s ./handlers/... ./auth/... ./mw/... ./internal/... ./db/...
|
||||
env:
|
||||
PGHOST: 127.0.0.1
|
||||
PGUSER: myuser
|
||||
PGPASSWORD: mypassword
|
||||
PGDATABASE: mydb
|
||||
Reference in New Issue
Block a user