From 223d30efd08c3858909f8158f3d7c5005a83ca93 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sat, 5 Sep 2026 14:40:14 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=96=B0=E5=A2=9E=20GitHub=20Actions?= =?UTF-8?q?=EF=BC=88go=20vet/test=20+=20tsc/lint/build=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 后端 job:go vet + go test;前端 job:tsc -b、oxlint、vite build - push/PR 触发;gui-test-screenshots/ 测试截图加入 .gitignore 本地保留 --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8a3d183 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + backend: + name: Backend (go vet + test) + runs-on: ubuntu-latest + defaults: + run: + working-directory: server + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: server/go.mod + cache-dependency-path: server/go.sum + + - name: Go module download + run: go mod download + + - name: go vet + run: go vet ./... + + - name: go test + run: go test ./... -count=1 + + frontend: + name: Frontend (typecheck + lint + build) + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Typecheck + run: npx tsc -b --force + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build diff --git a/.gitignore b/.gitignore index 6b954ea..79e1ef3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ server/bin/ *.exe *.test .codex_artifacts/ + +# 测试证据截图(本地保留,不入库) +gui-test-screenshots/