[OBS-2.b] Migrate Tauri commands to Result<_, BookieError> (#133) #160
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: [master] | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| security-rust: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.cargo/bin/cargo-audit | |
| key: cargo-audit-${{ runner.os }} | |
| restore-keys: cargo-audit- | |
| - name: Install cargo-audit | |
| run: cargo install --locked cargo-audit | |
| - name: Generate Cargo.lock | |
| run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml | |
| - name: Run cargo audit | |
| working-directory: src-tauri | |
| # cargo-audit auto-discovers .cargo/audit.toml relative to cwd, so | |
| # the project-local allowlist (src-tauri/.cargo/audit.toml) is | |
| # picked up here. | |
| run: cargo audit --deny warnings | |
| security-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install --frozen-lockfile | |
| - run: bun audit --audit-level=high | |
| test-frontend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Generate SvelteKit types ($lib path alias) | |
| # svelte-kit sync materializes .svelte-kit/tsconfig.json, which | |
| # supplies the $lib path alias that src/lib/db/connection.ts and | |
| # the smoke test rely on for module resolution under bun test. | |
| run: bunx svelte-kit sync | |
| - name: Run frontend tests | |
| run: bun test | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies | |
| # Tauri's GTK/WebKit bindings (glib-sys, gobject-sys, etc.) link | |
| # against system libraries via pkg-config, so the Rust crate graph | |
| # cannot even compile without these — required for `cargo test`. | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libappindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| libssl-dev \ | |
| libdbus-1-dev | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| src-tauri/target | |
| key: cargo-test-${{ runner.os }}-${{ hashFiles('src-tauri/Cargo.toml') }} | |
| restore-keys: cargo-test-${{ runner.os }}- | |
| - name: Run backend tests | |
| run: cargo test --manifest-path src-tauri/Cargo.toml |