-
Notifications
You must be signed in to change notification settings - Fork 0
ci: split golden master and hardware integration tests into separate CI jobs #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
aaf36f4
9c2ae87
e0c7783
8f33d2a
c27f96b
1e603c3
a8e8d00
485516f
addc3a0
ebf7b8c
98a9432
9e3c4d2
faf62c4
14a3202
7fc544f
89775d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Automatically activate Python venv and sync dependencies on cd | ||
| # Requires: direnv (https://direnv.net/) | ||
| # Install: sudo apt install direnv && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc | ||
|
|
||
| # Create venv if it doesn't exist | ||
| if [[ ! -d .venv ]]; then | ||
| echo "Creating .venv with uv..." | ||
| uv venv .venv | ||
| fi | ||
|
|
||
| # Activate the venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Ensure dependencies are synced | ||
| uv sync --quiet | ||
|
|
||
| # Set PYO3 to use this venv's Python | ||
| export PYO3_PYTHON="${PWD}/.venv/bin/python" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -97,7 +97,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Security scanning for vulnerabilities and license compliance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| security_audit: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Security Audit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: [self-hosted, Linux, X64, fedora, nobara] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -118,28 +118,28 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: cargo deny check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Build, check, and test with multiple Rust versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build_and_check: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build & Test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: [self-hosted, Linux, X64, fedora, nobara] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unit_tests_hosted: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Unit Tests & Golden Master (Hosted) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [setup-whisper-dependencies] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rust-version: [stable] # Use stable only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install system dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get install -y xdotool wget unzip gcc g++ make xvfb openbox dbus-x11 wl-clipboard xclip ydotool x11-utils wmctrl pkg-config pulseaudio libasound2-dev libgtk-3-dev libatspi-dev libxtst-dev python3-pip python3-venv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Rust toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| toolchain: ${{ matrix.rust-version }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| components: rustfmt, clippy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| override: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup ColdVox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/actions/setup-coldvox | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| skip-toolchain: "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Only run formatting and linting on stable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Check formatting (advisory) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: matrix.rust-version == 'stable' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -181,17 +181,24 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Running Tests ===" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo test --workspace --locked -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run Golden Master pipeline test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: matrix.rust-version == 'stable' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WHISPER_MODEL_PATH: ${{ needs.setup-whisper-dependencies.outputs.model_path }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WHISPER_MODEL_SIZE: ${{ needs.setup-whisper-dependencies.outputs.model_size }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Running Golden Master Test ===" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install Python dependencies for Golden Master | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install faster-whisper | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export PYTHONPATH=$(python3 -c "import site; print(site.getsitepackages()[0])") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo test -p coldvox-app --test golden_master -- --nocapture | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+190
to
+200
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # GUI groundwork check integrated here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Detect and test Qt 6 GUI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: matrix.rust-version == 'stable' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if bash scripts/ci/detect-qt6.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "✅ Qt 6 detected - building GUI" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cargo check -p coldvox-gui --features qt-ui --locked | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "⚠️ Qt 6 not detected - skipping GUI build" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Qt6 might not be easily available on ubuntu-latest without extra actions, skipping for now or adding if needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Skipping Qt6 check on hosted runner" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload test artifacts on failure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: failure() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -204,7 +211,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| retention-days: 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text_injection_tests: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Text Injection Tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Hardware Integration Tests (Self-Hosted) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: [self-hosted, Linux, X64, fedora, nobara] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [setup-whisper-dependencies] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -213,11 +220,26 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUST_LOG: debug | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUST_TEST_TIME_UNIT: 10000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUST_TEST_TIME_INTEGRATION: 30000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RUSTC_WRAPPER: sccache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SCCACHE_DIR: /home/coldaine/.cache/sccache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SCCACHE_DIR: /home/coldaine/.cache/sccache | |
| SCCACHE_DIR: $HOME/.cache/sccache |
Outdated
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sccache setup step attempts to start the server without checking if it's already running, which could cause errors on subsequent runs. Additionally, if the installation with cargo install fails (note the || true), the script continues to try starting the server which will fail. Consider checking if sccache is running before attempting to start it, and ensure proper error handling when sccache installation or startup fails.
| if command -v sccache >/dev/null; then | |
| echo "sccache found" | |
| sccache --start-server | |
| else | |
| echo "sccache not found, installing..." | |
| cargo install sccache --locked || true | |
| sccache --start-server | |
| fi | |
| set -euo pipefail | |
| if command -v sccache >/dev/null; then | |
| echo "sccache found" | |
| else | |
| echo "sccache not found, installing..." | |
| if ! cargo install sccache --locked; then | |
| echo "Failed to install sccache. Proceeding without sccache." | |
| exit 0 | |
| fi | |
| fi | |
| # Check if sccache server is already running | |
| if sccache --show-stats >/dev/null 2>&1; then | |
| echo "sccache server is already running." | |
| else | |
| echo "Starting sccache server..." | |
| if ! sccache --start-server; then | |
| echo "Failed to start sccache server. Proceeding without sccache." | |
| exit 0 | |
| fi | |
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.5.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-toml | ||
|
|
||
| - repo: https://github.com/rhysd/actionlint | ||
| rev: v1.6.26 | ||
| hooks: | ||
| - id: actionlint | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: cargo-fmt | ||
| name: cargo fmt | ||
| entry: cargo fmt --all -- --check | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
|
||
| - id: cargo-clippy | ||
| name: cargo clippy | ||
| entry: cargo clippy --all-targets --locked -- -D warnings | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false | ||
|
|
||
| - id: uv-lock-check | ||
| name: uv lock check | ||
| entry: uv lock --check | ||
| language: system | ||
| files: ^pyproject\.toml$|^uv\.lock$ | ||
| pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit_tests_hosted job installs many hardware and display-related system dependencies (xdotool, xvfb, openbox, dbus-x11, wl-clipboard, xclip, ydotool, x11-utils, wmctrl, pulseaudio, libasound2-dev, libgtk-3-dev, libatspi-dev, libxtst-dev) on the hosted runner. This contradicts the PR's stated goal of running only non-hardware-dependent tests on hosted runners. If these tests truly don't require display servers or audio hardware, these dependencies should be removed. If they do require them, those tests should be moved to the hardware integration tests job on the self-hosted runner.