Files
Lumotia/.github/workflows/check.yml
Jake da74a84009
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
ci: point Swatinem/rust-cache at the real workspace root
Both workflows had `workspaces: src-tauri -> target`, which tells
rust-cache the workspace lives at src-tauri/ and its target dir is
src-tauri/target. Neither is true: the workspace is defined at the repo
root (Cargo.toml:1–3 — members = ["src-tauri", "crates/*"]), so cargo
walks up and puts artifacts at ./target, not ./src-tauri/target.

Result: the cache action was saving an empty (or wrong) directory on
every run. Every CI run on every OS effectively started from a cold
build, which is the actual reason the Windows job appeared to compile
sqlx from scratch every push — it was compiling sqlx from scratch every
push.

Point the cache at the real workspace root. While here, drop the
`working-directory: src-tauri` on the cargo check step so the command
runs from the workspace root too; cargo finds the same workspace either
way, but running from root is consistent with the cache's view.

Expected impact: Windows check job drops from ~15–25 min cold-every-time
to ~2–3 min on warm runs, matching Linux/macOS behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 15:42:12 +01:00

110 lines
3.5 KiB
YAML

# Per-push fast feedback: cargo check on Linux + Windows + macOS, plus
# the Svelte build. Catches platform-specific compile errors (the M3
# fix that broke on Windows because std::sync::mpsc::TryRecvError lives
# in a different module on certain configurations, etc) without paying
# the cost of the full Tauri release build.
#
# For the full installer build (.msi, .dmg, .AppImage) see build.yml.
name: check
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# Cancel any earlier in-progress runs for the same branch — a fresh push
# supersedes the previous one.
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: cargo check (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
# System packages whisper-rs-sys + Tauri need on each OS.
# Linux is the heaviest because we depend on GTK/WebKit, audio,
# evdev, plus cmake for whisper.cpp.
- name: Install Linux deps
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
libasound2-dev \
libudev-dev \
patchelf \
cmake \
build-essential
# macOS: cmake is preinstalled in macos-latest but pin via brew to
# be explicit and future-proof.
- name: Install macOS deps
if: matrix.os == 'macos-latest'
run: |
brew list cmake >/dev/null 2>&1 || brew install cmake
# Windows: cmake + clang are needed by whisper-rs-sys. cmake is on
# windows-latest by default; ensure it.
- name: Install Windows deps
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# cmake is on the runner image; verify it.
cmake --version
# LLVM/clang for whisper.cpp's sources.
choco install -y llvm --no-progress
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# Cache the Cargo target dir + registry per OS so the heavy
# whisper-rs-sys C++ build only happens on a clean cache.
# The workspace root is the repo root (see //Cargo.toml), so target/
# lives at ./target — NOT src-tauri/target. Pointing the cache at
# src-tauri/target produced silent cache misses on every run and was
# the real reason Windows check times felt like they compiled sqlx
# from scratch every time. Use the repo root as the workspace hint.
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: .
shared-key: kon-${{ matrix.os }}
- name: cargo check (workspace)
run: cargo check --workspace --all-targets
frontend:
name: svelte build + lint
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install JS deps
run: npm ci
# `tauri build` inside check.yml would trigger the full Rust build
# which is owned by the rust job. Here we only validate that the
# Svelte/Vite frontend compiles cleanly.
- name: Build frontend (Vite only)
run: npm run build