19 #481
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: Test Suite | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| core-engine-test: | |
| name: Rust Core & SIMD | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust Stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Check Formatting | |
| run: cargo fmt --check | |
| - name: Clippy Linting | |
| continue-on-error: true | |
| run: cargo clippy --workspace --exclude qres-studio -- -D warnings | |
| - name: Install Linux Dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libasound2-dev pkg-config libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev | |
| - name: Run Core Unit Tests | |
| run: cargo test --workspace --exclude qres-studio --verbose | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Verify WASM Build | |
| working-directory: crates/qres_wasm | |
| run: wasm-pack build --target web | |
| - name: Verify Release Build | |
| run: cargo build --release --workspace --exclude qres-studio | |
| integration-test: | |
| name: Python Integration | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| needs: core-engine-test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Create Virtual Environment | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| - name: Build Python Extension | |
| working-directory: bindings/python | |
| run: | | |
| # Use the venv created in root | |
| source ../../.venv/bin/activate | |
| pip install maturin | |
| # Build Python extension from qres_core | |
| maturin develop --release | |
| - name: Verify Python Import | |
| run: | | |
| source .venv/bin/activate | |
| python -c "from qres import qres_rust; print('Rust core imported successfully')" | |
| python -c "from qres.qres_rust import encode_bytes, decode_bytes; print('Core functions available')" | |
| studio-test: | |
| name: GUI Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install Dependencies | |
| working-directory: web | |
| run: | | |
| npm ci | |
| npm run check | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-studio-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-studio- | |
| - name: Install Linux GUI Libs | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Check Backend | |
| working-directory: web/src-tauri | |
| run: cargo check |