diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 0cffe5933..99f30d759 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -94,3 +94,40 @@ jobs: echo "✅ Build completed successfully!" echo "Branch: ${GITHUB_REF_NAME}" echo "Commit: ${GITHUB_SHA}" + + # P3-4 Fix: 添加前端 Lint 检查 job + frontend-lint: + name: Frontend Lint + runs-on: ubuntu-latest + container: node:20 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: apps/web/package-lock.json + + - name: Install dependencies + working-directory: apps/web + run: npm ci + + - name: Run ESLint + working-directory: apps/web + run: npx eslint src --ext .ts,.tsx --max-warnings 0 + + - name: Run TypeScript type check + working-directory: apps/web + run: npx tsc --noEmit + + - name: Run Prettier check + working-directory: apps/web + run: npx prettier --check "src/**/*.{ts,tsx,css,md}" + + - name: Run Vitest tests + working-directory: apps/web + run: npx vitest run --coverage