feat: copy current document as rich text (#23) #75
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # macOS check: JS quality gates + Rust workspace check. | |
| # This is the primary check job and runs the full suite. | |
| # --------------------------------------------------------------------------- | |
| check-macos: | |
| name: Check (macOS) | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-r2-${{ hashFiles('src-tauri/Cargo.lock') }} | |
| - name: Install JS dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Typecheck | |
| run: bun run typecheck | |
| - name: Lint (Biome) | |
| run: bunx biome check src | |
| - name: Unit tests | |
| run: bun run test | |
| # Surface known-vulnerable JS dependencies. Soft-gated (continue-on-error) | |
| # so an upstream advisory annotates the run without blocking unrelated PRs. | |
| - name: Audit JS dependencies | |
| run: bun audit | |
| continue-on-error: true | |
| - name: Frontend build | |
| run: bunx vite build | |
| # tauri-build validates that bundle.resources paths exist at compile | |
| # time. The check job only type-checks Rust (it doesn't bundle), so | |
| # create empty stand-ins for the sidecars the macOS config references. | |
| - name: Stub sidecar binaries (resource existence check) | |
| run: | | |
| mkdir -p src-tauri/target/release | |
| touch src-tauri/target/release/mdopen \ | |
| src-tauri/target/release/mdopener-mcp \ | |
| src-tauri/target/release/mdopener-afm \ | |
| src-tauri/target/release/mdopener-setdefault | |
| - name: Rust check (workspace) | |
| run: cargo check --workspace --manifest-path src-tauri/Cargo.toml | |
| - name: Rust clippy (workspace) | |
| run: cargo clippy --workspace --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings | |
| # Audit Rust dependencies for known CVEs. Soft-gated like the JS audit. | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| continue-on-error: true | |
| - name: Audit Rust dependencies | |
| run: cargo audit --file src-tauri/Cargo.lock | |
| continue-on-error: true | |
| # --------------------------------------------------------------------------- | |
| # Linux check: catches cross-platform Rust compile breakage on PRs cheaply. | |
| # Runs only `cargo check` (no JS/Swift) against the Linux target. | |
| # --------------------------------------------------------------------------- | |
| check-linux: | |
| name: Check (Linux) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-r2-${{ hashFiles('src-tauri/Cargo.lock') }} | |
| # Tauri 2 Linux prerequisites — required for tauri-build to compile. | |
| - name: Install Linux system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| build-essential \ | |
| curl \ | |
| wget \ | |
| file \ | |
| libxdo-dev \ | |
| libssl-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf | |
| # tauri-build validates bundle.resources existence at compile time; the | |
| # Linux config references only the two Rust sidecars. Stub them so the | |
| # type-check proceeds without a full sidecar build. | |
| - name: Stub sidecar binaries (resource existence check) | |
| run: | | |
| mkdir -p src-tauri/target/release | |
| touch src-tauri/target/release/mdopen \ | |
| src-tauri/target/release/mdopener-mcp | |
| - name: Rust check (workspace) | |
| run: cargo check --workspace --manifest-path src-tauri/Cargo.toml |