diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfb04f22..1ed0c54c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,10 +75,62 @@ jobs: bandit-report.json safety-report.json + # Build Verification — ensure the Rust workspace compiles cleanly before running tests. + # Catches type errors, missing imports, and dependency resolution issues early. + rust-build: + name: Rust Build Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Tauri / GTK / serial system dev libraries + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libglib2.0-dev \ + libgtk-3-dev \ + libsoup-3.0-dev \ + libjavascriptcoregtk-4.1-dev \ + libwebkit2gtk-4.1-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libxdo-dev \ + libudev-dev \ + libdbus-1-dev \ + libssl-dev \ + pkg-config + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + v2/target + key: ${{ runner.os }}-cargo-build-${{ hashFiles('v2/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-build- + + - name: Build Rust workspace + working-directory: v2 + run: cargo build --workspace --no-default-features + + - name: TypeScript type-check (dashboard) + if: success() + run: | + cd ${{ github.workspace }}/dashboard + npm ci + npx tsc --noEmit + # Rust Workspace Tests rust-tests: name: Rust Workspace Tests runs-on: ubuntu-latest + needs: [rust-build] steps: - name: Checkout code uses: actions/checkout@v4