Skip to content

Update workflow to use ubuntu-latest and install git-lfs #339

Update workflow to use ubuntu-latest and install git-lfs

Update workflow to use ubuntu-latest and install git-lfs #339

Workflow file for this run

name: Rust CI 🦀
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SMART_TREE_NO_UPDATE_CHECK: 1
permissions:
contents: read
jobs:
check:
name: Format & Lint Check ✨
runs-on: self-hosted, macos-latest
steps:
- name: Install Git LFS (macOS)
if: matrix.os == 'macos-latest'
run: brew install git-lfs
z- name: Checkout code 📦
uses: actions/checkout@v4

Check failure on line 29 in .github/workflows/rust.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/rust.yml

Invalid workflow file

You have an error in your yaml syntax on line 29
with:
x submodules: 'recursive'
- name: Fetch LFS objects
run: git lfs pull
- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry 📚
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
build:
name: Build & Test - ${{ matrix.name }} 🔨
strategy:
matrix:
include:
- os: [ubuntu-latest]
name: Ubuntu
rust: stable
allow_failure: false
- os: [self-hosted, macos-latest]
name: Self-Hosted macos
rust: stable
allow_failure: false
- os: [windows-latest]
name: Windows
rust: stable
allow_failure: false
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_failure == true }}
steps:
# Install Git LFS for each OS
- name: Install Git LFS (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y git-lfs
- name: Install Git LFS (macOS)
if: matrix.os == 'macos-latest'
run: brew install git-lfs
- name: Install Git LFS (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: choco install git-lfs -y
- name: Checkout code 📦
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Fetch LFS objects
run: git lfs pull
- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Update submodules
run: git submodule update --init --recursive
- name: Cache cargo registry 📚
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index 📑
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Fetch LFS objects
run: git lfs pull
- name: Cache cargo build 🏗️
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust }}
restore-keys: |
${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-build-target-
- name: Build release 🚀
run: cargo build --release --verbose
- name: Run tests 🧪
shell: bash
run: |
echo "=== Performance Monitor Start ==="
echo "Time: $(date)"
echo "Memory: $(free -h 2>/dev/null || echo 'N/A')"
echo "CPU: $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 'N/A')"
echo "Disk: $(df -h . | tail -1)"
echo "================================"
# Run tests with timeout and performance tracking
if command -v timeout >/dev/null 2>&1; then
TIMEOUT_CMD="timeout 300"
elif command -v gtimeout >/dev/null 2>&1; then
TIMEOUT_CMD="gtimeout 300"
else
TIMEOUT_CMD=""
fi
RUST_TEST_THREADS=1 $TIMEOUT_CMD cargo test --lib --verbose -- --nocapture --test-threads=1 || exit_code=$?
echo "=== Performance Monitor End ==="
echo "Time: $(date)"
echo "Exit code: ${exit_code:-0}"
echo "=============================="
exit ${exit_code:-0}
- name: Run doc tests 📚
run: cargo test --doc --verbose
- name: Test examples 📝
if: matrix.os != 'windows-latest'
shell: bash
run: |
# Test that examples compile
for example in examples/*.rs; do
if [[ -f "$example" ]]; then
example_name=$(basename "$example" .rs)
echo "Testing example: $example_name"
cargo build --example "$example_name" || true
fi
done
# TEMPORARILY DISABLED: Binary execution hangs in CI
- name: Test binary execution 🎯
shell: bash
run: |
cargo run -- --version
cargo run -- --help
cargo run -- --mode classic --depth 1 .
cargo run -- --mode hex --depth 1 .
cargo run -- --mode ai --depth 1 .
- name: Test MCP tools listing 🛠️
if: matrix.os != 'windows-latest'
run: |
cargo run -- --mcp-tools | head -20
security:
name: Security Audit 🔒
runs-on: ubuntu-latest
steps:
- name: Install Git LFS (Linux)
run: sudo apt-get update && sudo apt-get install -y git-lfs
- name: Checkout code 📦
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Fetch LFS objects
run: git lfs pull
- name: Install Rust 🦀
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit 🔍
run: cargo install cargo-audit
- name: Run security audit 🛡️
run: cargo audit
continue-on-error: true