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/