Dockerfile: - Node 22 安装段追加 corepack enable + pnpm 11.8.0 - 缓存层从'只 tiptap 的 package.json'扩展为整个 workspace (libs/package.json + pnpm-workspace.yaml + pnpm-lock.yaml + 4 lib manifest), npm ci 改为 pnpm install --frozen-lockfile,覆盖全部 4 个 lib 的 Docker 层缓存 - 构建步骤 make build-editor 改为 make build-libs Gitea CI: - check job 的 Install Node 步骤加装 pnpm,新增 Biome lint 步骤 (cd libs && pnpm install --frozen-lockfile && pnpm exec biome check .) - build job 同步装 pnpm,make build 不变(Makefile 已改用 workspace) .dockerignore: 补齐其余 3 个 lib 的 public 产物 + workspace node_modules 模式 AGENTS.md: Development Commands 删 make clippy、新增 make lint/make fix 说明; Prerequisites 补 Biome;libs 段改为 pnpm workspace 模型;修正文档漂移 (tt-reveal→tt-expand,eval→Reflect::get)
113 lines
3.4 KiB
YAML
113 lines
3.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
env:
|
|
RUSTUP_UPDATE_ROOT: https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
|
|
RUSTUP_DIST_SERVER: https://mirrors.tuna.tsinghua.edu.cn/rustup
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git init
|
|
git remote add origin https://git.rua.plus/${{ github.repository }}.git
|
|
git fetch --depth 1 origin ${{ github.sha }}
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Configure Cargo mirror
|
|
run: |
|
|
mkdir -p "$HOME/.cargo"
|
|
printf '%s\n' '[source.crates-io]' "replace-with = 'rsproxy'" '' "[source.rsproxy]" 'registry = "sparse+https://rsproxy.cn/index/"' > "$HOME/.cargo/config.toml"
|
|
|
|
- name: Install Rust toolchain
|
|
run: |
|
|
for i in 1 2 3; do
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && break
|
|
echo "rustup install attempt $i failed, retrying..."
|
|
sleep 15
|
|
done
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install Node.js & pnpm
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y nodejs npm
|
|
npm install -g pnpm
|
|
|
|
- name: Install Rust target
|
|
run: rustup target add wasm32-unknown-unknown
|
|
|
|
- name: Install Dioxus CLI
|
|
run: cargo install dioxus-cli --locked
|
|
|
|
- name: Install Tailwind CSS CLI
|
|
run: npm install -g @tailwindcss/cli
|
|
|
|
- name: Check formatting
|
|
run: cargo fmt -- --check
|
|
|
|
- name: Run Clippy
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
- name: Biome lint (libs)
|
|
run: cd libs && pnpm install --frozen-lockfile && pnpm exec biome check .
|
|
|
|
- name: Run tests
|
|
run: cargo test --all-features
|
|
|
|
- name: Dioxus check
|
|
run: dx check
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: check
|
|
env:
|
|
RUSTUP_UPDATE_ROOT: https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
|
|
RUSTUP_DIST_SERVER: https://mirrors.tuna.tsinghua.edu.cn/rustup
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git init
|
|
git remote add origin https://git.rua.plus/${{ github.repository }}.git
|
|
git fetch --depth 1 origin ${{ github.sha }}
|
|
git checkout ${{ github.sha }}
|
|
|
|
- name: Configure Cargo mirror
|
|
run: |
|
|
mkdir -p "$HOME/.cargo"
|
|
printf '%s\n' '[source.crates-io]' "replace-with = 'rsproxy'" '' "[source.rsproxy]" 'registry = "sparse+https://rsproxy.cn/index/"' > "$HOME/.cargo/config.toml"
|
|
|
|
- name: Install Rust toolchain
|
|
run: |
|
|
for i in 1 2 3; do
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && break
|
|
echo "rustup install attempt $i failed, retrying..."
|
|
sleep 15
|
|
done
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install Node.js & pnpm
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y nodejs npm
|
|
npm install -g pnpm
|
|
|
|
- name: Install Rust target
|
|
run: rustup target add wasm32-unknown-unknown
|
|
|
|
- name: Install Dioxus CLI
|
|
run: cargo install dioxus-cli --locked
|
|
|
|
- name: Install Tailwind CSS CLI
|
|
run: npm install -g @tailwindcss/cli
|
|
|
|
- name: Build release
|
|
run: make build
|