From e7e4f43691c7c34c650dfba878f5946ef61a912c Mon Sep 17 00:00:00 2001 From: LanQin Date: Sun, 21 Jun 2026 02:30:01 +0800 Subject: [PATCH] =?UTF-8?q?ci(.github/workflows):=20=E6=8B=86=E5=88=86=20C?= =?UTF-8?q?I=20=E4=B8=8E=E5=8F=91=E5=B8=83=E6=B5=81=E7=A8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增独立的 CI 工作流,覆盖前端检查、构建和后端测试。 - 调整 Docker 工作流为仅负责标签发布与镜像构建。 - 同步优化管理页 Issues 图标颜色。 --- .github/workflows/ci.yml | 61 ++++++++++++++++++++++++++++++++++++ .github/workflows/docker.yml | 16 +--------- apps/web/src/pages/admin.tsx | 2 +- 3 files changed, 63 insertions(+), 16 deletions(-) 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..7c2b97b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: CI + +on: + push: + branches: + - main + paths-ignore: + - "**/*.md" + - "deploy/.env.example" + pull_request: + branches: + - main + paths-ignore: + - "**/*.md" + - "deploy/.env.example" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + checks: + name: Check web and api + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.28.2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + + - name: Install web dependencies + run: pnpm install --frozen-lockfile --filter lanqin-email-web... + + - name: Check shadcn/ui usage + run: pnpm --dir apps/web run check:shadcn + + - name: Build web + run: pnpm --dir apps/web run build + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: apps/api/go.mod + cache-dependency-path: apps/api/go.sum + + - name: Test api + working-directory: apps/api + run: go test ./... diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8af1862..538bd95 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,21 +1,9 @@ -name: CI and Docker +name: Docker Release on: push: - branches: - - main tags: - "v*" - paths-ignore: - - "**/*.md" - - "deploy/.env.example" - pull_request: - branches: - - main - paths-ignore: - - "**/*.md" - - "deploy/.env.example" - workflow_dispatch: permissions: contents: read @@ -72,7 +60,6 @@ jobs: name: Resolve release tag runs-on: ubuntu-latest needs: checks - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') outputs: tag: ${{ steps.release.outputs.tag }} version: ${{ steps.release.outputs.version }} @@ -94,7 +81,6 @@ jobs: name: Build and publish ${{ matrix.name }} runs-on: ubuntu-latest needs: release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') strategy: fail-fast: false matrix: diff --git a/apps/web/src/pages/admin.tsx b/apps/web/src/pages/admin.tsx index 1def604..1d3121a 100644 --- a/apps/web/src/pages/admin.tsx +++ b/apps/web/src/pages/admin.tsx @@ -781,7 +781,7 @@ function AboutProjectCard() {