chore(ci): 新增 CI(前端 build→go build/vet/test→cross-compile 矩阵 + 覆盖率上报);README 同步 M0-M11 状态/快速开始/技术栈/文档索引

This commit is contained in:
Aska committed 2026-09-06 08:13:12 +08:00
1 parent a7feaeb2cb
commit 3146b515f3
2 files changed
+101 -26

No files matched your search

+69
View File
@@ -0,0 +1,69 @@
name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
backend:
name: Backend (build / vet / test / cross-compile)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26"
# `go:embed` 需要 internal/webui/dist 存在(前端先构建并拷贝)。
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Build frontend (produces internal/webui/dist)
working-directory: frontend/web
run: |
npm ci
npm run build
- name: go build
run: go build ./...
- name: go vet
run: go vet ./...
- name: go test (with coverage)
run: go test ./... -count=1 -coverprofile=coverage.out
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
- name: Cross-compile matrix
run: |
set -e
for t in "linux amd64 " "linux arm64 " "linux arm 7" "darwin amd64 " "darwin arm64 " "windows amd64 " "windows arm64 "; do
set -- $t
echo "== building $1/$2/$3 =="
GOOS=$1 GOARCH=$2 GOARM=$3 go build ./...
done
frontend:
name: Frontend (tsc + vite build)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Build
working-directory: frontend/web
run: |
npm ci
npm run build