From 6dc32dca9321a5c7c667657238f2e9742642835b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Wed, 27 May 2026 00:52:13 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20CI=20workflow=20?= =?UTF-8?q?=E2=80=94=20push=20=E8=87=AA=E5=8A=A8=E6=A3=80=E6=9F=A5=20TypeS?= =?UTF-8?q?cript=20+=20Rust?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端: tsc --noEmit + ESLint + Vitest (ubuntu) Rust: cargo check + clippy + test (windows + GNU toolchain) Co-Authored-By: Claude Opus 4.7 --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 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..2fac671 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + branches: + - '**' + tags-ignore: + - '**' + +jobs: + frontend: + name: 前端检查 (TypeScript + Lint + Test) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - run: npm ci + + - name: TypeScript 类型检查 + run: npx tsc --noEmit + + - name: ESLint + run: npm run lint + + - name: Vitest 测试 + run: npm test + + rust: + name: Rust 检查 (Check + Clippy + Test) + runs-on: windows-latest + defaults: + run: + working-directory: src-tauri + steps: + - uses: actions/checkout@v4 + + - name: 安装 GNU 工具链 + run: | + rustup toolchain install stable-x86_64-pc-windows-gnu + rustup override set stable-x86_64-pc-windows-gnu + + - name: 添加 MinGW 到 PATH + run: echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + + - name: Cargo Check + run: cargo check + + - name: Cargo Clippy + run: cargo clippy -- -D warnings + + - name: Cargo Test + run: cargo test