fix: preserve realtime view state across remounts #318
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR 检查 | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - dev | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - dev | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows | |
| arch: x86_64 | |
| runner: windows-latest | |
| - platform: macos | |
| arch: x86_64 | |
| runner: macos-15-intel | |
| - platform: macos | |
| arch: aarch64 | |
| runner: macos-latest | |
| - platform: linux | |
| arch: x86_64 | |
| runner: ubuntu-22.04 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 安装 Rust 稳定版 | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 初始化前端工具链 | |
| uses: ./.github/actions/setup-frontend | |
| - name: 核心类型检查 | |
| if: matrix.platform == 'linux' | |
| run: | | |
| pnpm run build:packages | |
| ./node_modules/.bin/vue-tsc --noEmit | |
| - name: 核心回归测试 | |
| if: matrix.platform == 'linux' | |
| run: | | |
| if command -v rg >/dev/null 2>&1; then | |
| mapfile -t core_tests < <( | |
| rg --files \ | |
| -g '**/__tests__/*.test.ts' \ | |
| -g '!src-tauri/target/**' \ | |
| -g '!dist/**' \ | |
| -g '!coverage/**' \ | |
| | sort | |
| ) | |
| else | |
| mapfile -t core_tests < <( | |
| find . \ | |
| -type d \( -name node_modules -o -path './src-tauri/target' -o -name dist -o -name coverage \) -prune -o \ | |
| -type f -path '*/__tests__/*.test.ts' -print \ | |
| | sort | |
| ) | |
| fi | |
| if [ "${#core_tests[@]}" -eq 0 ]; then | |
| echo "未找到核心回归测试文件" | |
| exit 1 | |
| fi | |
| echo "核心回归测试文件列表:" | |
| printf ' - %s\n' "${core_tests[@]}" | |
| ./node_modules/.bin/vitest run "${core_tests[@]}" | |
| - name: Rust 缓存 | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: 安装 Ubuntu 依赖 | |
| if: matrix.platform == 'linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev | |
| - name: 类型检查 | |
| run: pnpm run build | |
| - name: Tauri 构建测试 | |
| run: pnpm run tauri build | |
| - name: 上传构建产物 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-${{ matrix.arch }}-build | |
| path: src-tauri/target/release/bundle/ | |
| if-no-files-found: warn | |
| retention-days: 7 |