refactor: unify CI workflow - use .forgejo/workflows

- Migrate from .gitea to .forgejo (Forgejo standard naming)
- Merge test + build-prod into single CI workflow
- Test runs on all PRs and main pushes
- Build-push only runs on main after test passes
- Use FORGEJO_REGISTRY_USER/TOKEN secrets for Docker login
- Remove docker-in-docker dind complexity
- Follow unified Forgejo CI pattern from CLAUDE.md
This commit is contained in:
2026-09-14 22:34:07 +09:00
parent b09d0ee42b
commit c924130fca
3 changed files with 95 additions and 108 deletions
-51
View File
@@ -1,51 +0,0 @@
name: ci
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: golang
container:
image: golang:1.26
env:
GOPRIVATE: forgejo.riotpiao.com
GOFLAGS: -mod=readonly
REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }}
steps:
- name: install node (required by JS-based actions)
run: apt-get update && apt-get install -y --no-install-recommends nodejs ca-certificates git
- uses: actions/checkout@v4
- name: configure git auth for private module fetch
run: |
git config --global url."https://oauth2:${REGISTRY_PAT}@forgejo.riotpiao.com".insteadOf "https://forgejo.riotpiao.com"
- name: gofmt
run: |
fmt_out="$(gofmt -l .)"
if [ -n "$fmt_out" ]; then
echo "$fmt_out"
echo "::error::gofmt found unformatted files, run 'gofmt -w .'"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go build
run: go build ./cmd/server ./cmd/queue-operator
- name: go test
run: go test ./... -race -coverprofile=coverage.out
- name: coverage summary
run: go tool cover -func=coverage.out | tail -1