ci: add build verification step before running tests

- Add rust-build job that compiles the full Rust workspace before tests run
- Add TypeScript type-check for the dashboard using tsc --noEmit
- rust-tests job now depends on rust-build to catch compile errors early
This commit is contained in:
Hermes Agent 2026-05-24 14:12:03 +00:00
parent 19e750430f
commit 7444e4b7c0
1 changed files with 52 additions and 0 deletions

View File

@ -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