name: Tests on: push: branches: [main] pull_request: branches: [main] workflow_dispatch: jobs: frontend: name: Frontend (Vitest) runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 with: run_install: false - uses: actions/setup-node@v6 with: node-version: "22" cache: "pnpm" - run: pnpm install --frozen-lockfile - name: Type-check run: pnpm typecheck - name: Unit + component tests run: pnpm test backend: name: Backend (cargo test) runs-on: windows-latest steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 with: run_install: false - uses: actions/setup-node@v6 with: node-version: "22" cache: "pnpm" - uses: dtolnay/rust-toolchain@stable - name: Install pnpm deps run: pnpm install --frozen-lockfile # Tauri's `generate_context!` macro reads the frontendDist path at # compile time, so we need a dist/ so the macro doesn't error before # we run the actual build. - name: Build frontend (so dist/ exists for tauri context) run: pnpm build # tauri.conf.json declares ../credentials.json as a bundled resource, # so the Tauri build script verifies the file exists at compile time. # The unit tests don't actually open it, so a placeholder works fine # and avoids needing the real Google secret on PR runs from forks. - name: Stub credentials.json shell: pwsh run: | @' {"installed":{"client_id":"stub","project_id":"stub","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","client_secret":"stub","redirect_uris":["http://localhost"]}} '@ | Set-Content credentials.json -Encoding UTF8 -NoNewline - name: Cargo test --lib working-directory: src-tauri run: cargo test --lib