-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (30 loc) · 948 Bytes
/
Copy pathci.yml
File metadata and controls
31 lines (30 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: CI
on:
push: { branches: [main] }
pull_request: { branches: [main] }
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
cache-dependency-path: go.sum
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
# lint 棘轮(.golangci.yml 从 0 issues 起步,只收紧不放宽)
- name: Lint (golangci-lint)
uses: golangci/golangci-lint-action@v8
with:
version: v2.14
args: --timeout 9m
- name: Dep guard(core 不许依赖下游)
run: |
BAD=$(go list -deps ./... | grep -E '^github.com/filescodebox/(server|frontend|fnos)' || true)
if [ -n "$BAD" ]; then echo "✗ core 违规依赖:"; echo "$BAD"; exit 1; fi
echo "✓ 依赖方向合规"