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:
@@ -0,0 +1,29 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
fmt:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
- run: |
|
||||||
|
out=$(gofmt -l .)
|
||||||
|
if [ -n "$out" ]; then
|
||||||
|
echo "Files not formatted:"
|
||||||
|
echo "$out"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
- run: go test ./...
|
||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
"thuanle.me/claw-email-bridge/internal/config"
|
"thuanle.me/claw-email-bridge/internal/config"
|
||||||
"thuanle.me/claw-email-bridge/internal/database"
|
"thuanle.me/claw-email-bridge/internal/database"
|
||||||
"thuanle.me/claw-email-bridge/internal/logging"
|
"thuanle.me/claw-email-bridge/internal/logging"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Retry backoff schedule: 1s, 5s, 15s.
|
// Retry backoff schedule: 1s, 5s, 15s.
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"gorm.io/gorm"
|
||||||
"thuanle.me/claw-email-bridge/internal/database"
|
"thuanle.me/claw-email-bridge/internal/database"
|
||||||
"thuanle.me/claw-email-bridge/internal/logging"
|
"thuanle.me/claw-email-bridge/internal/logging"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// CallbackRequest is the payload received from OpenClaw.
|
// CallbackRequest is the payload received from OpenClaw.
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ import (
|
|||||||
"github.com/emersion/go-imap/v2/imapclient"
|
"github.com/emersion/go-imap/v2/imapclient"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
|
"gorm.io/gorm"
|
||||||
"thuanle.me/claw-email-bridge/internal/config"
|
"thuanle.me/claw-email-bridge/internal/config"
|
||||||
"thuanle.me/claw-email-bridge/internal/database"
|
"thuanle.me/claw-email-bridge/internal/database"
|
||||||
"thuanle.me/claw-email-bridge/internal/logging"
|
"thuanle.me/claw-email-bridge/internal/logging"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// IMAPWatcher monitors an IMAP mailbox via IDLE and processes new emails.
|
// IMAPWatcher monitors an IMAP mailbox via IDLE and processes new emails.
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
"thuanle.me/claw-email-bridge/internal/config"
|
"thuanle.me/claw-email-bridge/internal/config"
|
||||||
"thuanle.me/claw-email-bridge/internal/database"
|
"thuanle.me/claw-email-bridge/internal/database"
|
||||||
"thuanle.me/claw-email-bridge/internal/logging"
|
"thuanle.me/claw-email-bridge/internal/logging"
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Retry backoff schedule: 1s, 5s, 15s.
|
// Retry backoff schedule: 1s, 5s, 15s.
|
||||||
|
|||||||
Reference in New Issue
Block a user