chore(ci): split workflows by changed area
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
name: Backend CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "server/**"
|
||||
- ".gitea/workflows/backend-ci.yml"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "server/**"
|
||||
- ".gitea/workflows/backend-ci.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
name: Backend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: server/go.mod
|
||||
cache-dependency-path: server/go.sum
|
||||
|
||||
- name: Add Go bin to PATH
|
||||
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Install sqlc
|
||||
run: go install github.com/sqlc-dev/sqlc/cmd/sqlc@v1.30.0
|
||||
|
||||
- name: Generate sqlc code
|
||||
working-directory: server
|
||||
run: make sqlc-generate
|
||||
|
||||
- name: Verify generated code is committed
|
||||
run: git diff --exit-code -- server/internal/tenant/repository/generated
|
||||
|
||||
- name: Check tenant SQL scope guard
|
||||
working-directory: server
|
||||
run: make tenant-scope-guard
|
||||
|
||||
- name: Run tests
|
||||
working-directory: server
|
||||
run: make test
|
||||
|
||||
- name: Build Go commands
|
||||
working-directory: server
|
||||
run: go build ./cmd/...
|
||||
Reference in New Issue
Block a user