CI Tool Implemented

The cargo ci tool provides unified build verification and testing for all Symposium components across Rust, TypeScript, and Swift.

Quick Reference

cargo ci              # Check compilation (default)
cargo ci check        # Check that all components compile
cargo ci test         # Run all tests

Commands

The CI tool provides two subcommands:

#![allow(unused)]
fn main() {
#[derive(Parser)]
enum Commands {
    /// Check that all components compile
    Check,
    /// Run all tests
    Test,
}
}

Check Command

Verifies that all components compile without running tests:

#![allow(unused)]
fn main() {
/// Check that all components compile
fn run_check() -> Result<()> {
    println!("🤖 Symposium CI Check");
    println!("{}", "=".repeat(26));

    // Check basic prerequisites
    check_rust()?;
    check_node()?;

    // Check all components compile
    check_rust_server()?;
    build_extension()?;
    
    // Only build macOS app on macOS
    if cfg!(target_os = "macos") {
        build_macos_app()?;
    } else {
        println!("⏭️  Skipping macOS app build (not on macOS)");
    }

    println!("\n✅ All components check passed!");
    Ok(())
}
}

What it does:

  • Checks Rust MCP server with cargo check --release
  • Builds TypeScript VSCode extension with npm ci + npm run webpack
  • Builds Swift macOS app with swift build --configuration release (macOS only)

Test Command

Runs test suites for all components:

#![allow(unused)]
fn main() {
/// Run all tests
fn run_test() -> Result<()> {
    println!("🤖 Symposium CI Test");
    println!("{}", "=".repeat(25));

    // Check basic prerequisites
    check_rust()?;
    check_node()?;

    // Run tests for all components
    run_rust_tests()?;
    run_typescript_tests()?;
    
    // Run Swift tests if they exist (macOS only)
    if cfg!(target_os = "macos") {
        run_swift_tests()?;
    } else {
        println!("⏭️  Skipping Swift tests (not on macOS)");
    }

    println!("\n✅ All tests completed!");
    Ok(())
}
}

What it does:

  • Runs Rust tests with cargo test --workspace
  • Runs TypeScript tests with npm test (if test script exists)
  • Runs Swift tests with swift test (if Tests directory exists, macOS only)

Component Details

Rust MCP Server

#![allow(unused)]
fn main() {
/// Check Rust MCP server compilation
fn check_rust_server() -> Result<()> {
    let repo_root = get_repo_root()?;
    let server_dir = repo_root.join("symposium/mcp-server");

    println!("🦀 Checking Rust MCP server...");
    println!("   Checking in: {}", server_dir.display());

    let output = Command::new("cargo")
        .args(["check", "--release"])
        .current_dir(&server_dir)
        .output()
        .context("Failed to execute cargo check")?;

    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        return Err(anyhow!(
            "❌ Failed to check Rust server:\n   Error: {}",
            stderr.trim()
        ));
    }

    println!("✅ Rust server check passed!");
    Ok(())
}
}

Uses cargo check --release for fast type checking without code generation. Runs in symposium/mcp-server directory.

TypeScript VSCode Extension

#![allow(unused)]
fn main() {
/// Build VSCode extension
fn build_extension() -> Result<()> {
    let repo_root = get_repo_root()?;
    let extension_dir = repo_root.join("symposium/vscode-extension");

    println!("\n📦 Building VSCode extension...");

    // Install dependencies
    println!("📥 Installing extension dependencies...");
    let output = Command::new("npm")
        .args(["ci"])
        .current_dir(&extension_dir)
        .output()
        .context("Failed to execute npm ci")?;

    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        return Err(anyhow!(
            "❌ Failed to install extension dependencies:\n   Error: {}",
            stderr.trim()
        ));
    }

    // Build extension for production
    println!("🔨 Building extension...");
    let output = Command::new("npm")
        .args(["run", "webpack"])
        .current_dir(&extension_dir)
        .output()
        .context("Failed to execute npm run webpack")?;

    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        return Err(anyhow!(
            "❌ Failed to build extension:\n   Error: {}",
            stderr.trim()
        ));
    }

    println!("✅ VSCode extension built successfully!");
    Ok(())
}
}

Two-step process:

  1. npm ci - Clean install of dependencies from package-lock.json
  2. npm run webpack - Production build of extension

Runs in symposium/vscode-extension directory.

Swift macOS Application

#![allow(unused)]
fn main() {
/// Build macOS app
fn build_macos_app() -> Result<()> {
    let repo_root = get_repo_root()?;
    let app_dir = repo_root.join("symposium").join("macos-app");

    println!("\n🍎 Building macOS application...");
    println!("   Building in: {}", app_dir.display());

    let output = Command::new("swift")
        .args(["build", "--configuration", "release"])
        .current_dir(&app_dir)
        .output()
        .context("Failed to execute swift build")?;

    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        let stdout = String::from_utf8_lossy(&output.stdout);
        return Err(anyhow!(
            "❌ Failed to build macOS app:\n   stdout: {}\n   stderr: {}",
            stdout.trim(),
            stderr.trim()
        ));
    }

    println!("✅ macOS application built successfully!");
    Ok(())
}
}

Uses swift build --configuration release for production builds. Runs in symposium/macos-app directory. Automatically skipped on non-macOS platforms.

Running Locally

Check Everything Compiles

cargo ci check

This is the fastest way to verify your changes compile across all platforms.

Run All Tests

cargo ci test

Runs the full test suite. Note that Swift tests only run on macOS.

Individual Components

You can also test components directly:

# Rust only
cd symposium/mcp-server && cargo check --release

# TypeScript only
cd symposium/vscode-extension && npm ci && npm run webpack

# Swift only (macOS)
cd symposium/macos-app && swift build --configuration release

GitHub Actions Integration

The CI tool is used in GitHub Actions workflows with dependency caching:

- name: Run CI check
  run: cargo ci check

- name: Run CI tests  
  run: cargo ci test

Caching includes:

  • Cargo registry and git database
  • Cargo target directories
  • npm node_modules

See .github/workflows/ci.yml for complete configuration.

Implementation

The CI tool is implemented as a dedicated crate in ci/ with a cargo alias defined in .cargo/config.toml:

[alias]
ci = "run -p ci --"

This allows running cargo ci from anywhere in the workspace.