ci: add Gitea Actions workflow with gofmt and test jobs
Add CI workflow at .gitea/workflows/ci.yml triggered on pull_request with two jobs: fmt (gofmt check) and test (go test ./...). Fix gofmt issues (import ordering) in 7 files so CI passes from the start. Fixes #7 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"thuanle.me/claw-email-bridge/internal/config"
|
||||
"thuanle.me/claw-email-bridge/internal/database"
|
||||
"thuanle.me/claw-email-bridge/internal/logging"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Retry backoff schedule: 1s, 5s, 15s.
|
||||
@@ -20,11 +20,11 @@ var retryBackoffs = []time.Duration{1 * time.Second, 5 * time.Second, 15 * time.
|
||||
|
||||
// openClawRequest is the payload sent to OpenClaw API.
|
||||
type openClawRequest struct {
|
||||
Input string `json:"input"`
|
||||
SessionID string `json:"session_id"`
|
||||
History []historyEntry `json:"history,omitempty"`
|
||||
CallbackURL string `json:"callback_url"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
Input string `json:"input"`
|
||||
SessionID string `json:"session_id"`
|
||||
History []historyEntry `json:"history,omitempty"`
|
||||
CallbackURL string `json:"callback_url"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
type historyEntry struct {
|
||||
|
||||
@@ -130,9 +130,9 @@ func TestDispatch_UsesCallbackBaseURL(t *testing.T) {
|
||||
defer mockServer.Close()
|
||||
|
||||
cfg := &config.Config{
|
||||
OpenClawURL: mockServer.URL,
|
||||
ListenAddr: ":9999",
|
||||
CallbackBaseURL: "https://bridge.example.com/",
|
||||
OpenClawURL: mockServer.URL,
|
||||
ListenAddr: ":9999",
|
||||
CallbackBaseURL: "https://bridge.example.com/",
|
||||
}
|
||||
|
||||
task := &database.Task{
|
||||
|
||||
Reference in New Issue
Block a user