From 3c3e3b7ae4c869e94effed49687fdb2e8e20a6bb Mon Sep 17 00:00:00 2001 From: lehel Date: Wed, 1 Oct 2025 17:03:09 +0200 Subject: [PATCH] gitea support --- .gitea/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++ .idea/copilotDiffState.xml | 18 ---------------- README.md | 26 ++++++++++++++++++++++- 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/ci.yml delete mode 100644 .idea/copilotDiffState.xml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..13fb5b7 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 10 + env: + OPENAI_API_KEY: dummy + OPENAI_BASE_URL: http://localhost:11434/api/chat + OPENAI_MODEL: qwen3:latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Go Env + run: go env + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -count=1 ./... + + - name: Build + run: go build -v ./... + + - name: Display Go version + run: go version + diff --git a/.idea/copilotDiffState.xml b/.idea/copilotDiffState.xml deleted file mode 100644 index fc8074a..0000000 --- a/.idea/copilotDiffState.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index 318ac3b..1324a7c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Lightweight veterinary visit reasoning helper with LLM-assisted keyword extracti - Structured JSON outputs enforced using provider-supported response formats (Ollama `format`, OpenAI/OpenRouter `response_format: { type: json_object }`). - Integration tests using mock LLM & DB (no network dependency). - GitHub Actions CI (vet, test, build). +- Gitea Actions CI parity (same steps mirrored under `.gitea/workflows/ci.yml`). ## Quick Start ### 1. Clone & build @@ -77,6 +78,30 @@ All tests mock the LLM so no network is required. ## CI GitHub Actions workflow at `.github/workflows/ci.yml` runs vet, tests, build on push/PR. +### Gitea Actions Support +A mirrored workflow exists at `.gitea/workflows/ci.yml` so self-hosted Gitea instances (with Actions/`act_runner`) execute the same pipeline: +- Triggers: push to `main` / `master`, pull requests, manual dispatch. +- Steps: checkout, Go setup (from `go-version-file`), vet, test, build. +- Default dummy env vars (override with repository secrets if needed). + +To add real secrets in Gitea (names should match those used in code): +1. In the repository UI: Settings → Secrets → Actions (menu names may differ slightly by Gitea version). +2. Add `OPENAI_API_KEY` (optional for OpenRouter usage). +3. (Optional) Add `OPENAI_MODEL` / `OPENAI_BASE_URL` overrides if you want CI integration tests against a live endpoint (currently tests are mocked and do not require network access). + +If you later add integration tests that call a real provider, modify the workflow: +```yaml +env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_BASE_URL: https://openrouter.ai/api/v1/chat/completions + OPENAI_MODEL: meta-llama/llama-3.1-70b-instruct +``` +Make sure rate limits and billing are acceptable before enabling real calls. + +Runner notes: +- Ensure your Gitea Actions runner image includes Git and Go toolchain or relies on `actions/setup-go` (supported in newer Gitea releases with remote action fetching). +- If remote action fetching is restricted, vendor the actions by mirroring their repositories or replace with inline shell steps (fallback approach). + ## Troubleshooting | Symptom | Cause | Fix | |---------|-------|-----| @@ -102,4 +127,3 @@ If some models wrap JSON in text, a post-processor could strip code fences and r ## License (Choose and add a LICENSE file if planning to open source.) -