# Path is .gitea/workflows/, not .forgejo/workflows/ -- verified live on this # Forgejo instance (forgejo.riotpiao.com) that a .forgejo/workflows/*.yaml # file never creates an action_run row on push, for any repo. This CI has # never once executed until this move. name: ci on: push: branches: [main] pull_request: jobs: buf: runs-on: golang container: image: bufbuild/buf:latest steps: # Manual git clone (no actions/checkout@v4 since bufbuild/buf has no node.js). # Use forgejo.riotpiao.com directly + REGISTRY_PAT for auth. - name: checkout env: REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }} run: | git clone "https://oauth2:${REGISTRY_PAT}@forgejo.riotpiao.com/rock/kmsvc-proto.git" . git checkout "${{ github.sha }}" - name: buf lint run: buf lint - name: buf breaking (against main) run: buf breaking --against '.git#branch=main' if: github.ref != 'refs/heads/main' codegen-check: runs-on: golang container: image: golang:1.26 steps: # Manual git clone (no actions/checkout@v4 since golang:1.26 has no node.js). # Use forgejo.riotpiao.com directly + REGISTRY_PAT for auth. - name: checkout env: REGISTRY_PAT: ${{ secrets.REGISTRY_PAT }} run: | git clone "https://oauth2:${REGISTRY_PAT}@forgejo.riotpiao.com/rock/kmsvc-proto.git" . git checkout "${{ github.sha }}" - name: Install buf and protoc plugins run: | go install github.com/bufbuild/buf/cmd/buf@latest go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest - name: Regenerate and diff run: | export PATH="$PATH:$(go env GOPATH)/bin" buf generate git diff --exit-code -- gen || (echo "::error::gen/ is out of date — run buf generate and commit the result" && exit 1) - name: go build run: go build ./...