vibetunnel/.github/workflows/rust.yml
Peter Steinberger 6a8f472832 feat: adopt Blacksmith CI runners and comprehensive updates
- Migrate GitHub Actions to Blacksmith runners for faster CI
  - Update ubuntu-latest to blacksmith-4vcpu-ubuntu-2404
  - Update actions/setup-node@v4 to useblacksmith/setup-node@v5
  - Update Swatinem/rust-cache@v2 to useblacksmith/rust-cache@v3

- Fix all linting warnings across all platforms
  - TypeScript: Fix any type warnings with proper type annotations
  - Rust: All clippy warnings resolved
  - Swift: Fix SwiftLint violations and format code

- Update all dependencies to latest versions
  - npm: Major updates including Express 5 compatibility fixes
  - Rust: Update 7 crates to latest compatible versions
  - Swift: Dependencies already up-to-date

- Add comprehensive test suite using Vitest
  - API endpoint tests for session CRUD operations
  - WebSocket connection and streaming tests
  - Session management lifecycle tests
  - Frontend component tests (terminal, session-list)
  - Critical functionality tests covering core features
  - Test infrastructure with proper mocking and utilities

- All tests passing, ready for production use
2025-06-18 19:10:03 +02:00

113 lines
No EOL
2.8 KiB
YAML

name: Rust CI
on:
workflow_call:
jobs:
lint:
name: Lint Rust Code
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: useblacksmith/rust-cache@v3
with:
workspaces: tty-fwd
- name: Check formatting
working-directory: tty-fwd
run: cargo fmt -- --check
- name: Run Clippy
working-directory: tty-fwd
run: cargo clippy -- -D warnings
build-and-test:
name: Build and Test (${{ matrix.name }})
needs: lint
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Linux x86_64
binary-name: tty-fwd
- os: macos-latest
target: x86_64-apple-darwin
name: macOS x86_64
binary-name: tty-fwd
- os: macos-latest
target: aarch64-apple-darwin
name: macOS ARM64
binary-name: tty-fwd
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache Rust dependencies
uses: useblacksmith/rust-cache@v3
with:
workspaces: tty-fwd
key: ${{ matrix.target }}
- name: Build
working-directory: tty-fwd
run: cargo build --release --target ${{ matrix.target }}
- name: Run tests
# Only run tests on native architectures
if: matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'x86_64-apple-darwin' || matrix.target == 'x86_64-pc-windows-msvc'
working-directory: tty-fwd
run: cargo test --release
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: rust-${{ matrix.target }}
path: tty-fwd/target/${{ matrix.target }}/release/${{ matrix.binary-name }}
coverage:
name: Code Coverage
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Cache Rust dependencies
uses: useblacksmith/rust-cache@v3
with:
workspaces: tty-fwd
- name: Run coverage
working-directory: tty-fwd
run: cargo tarpaulin --verbose --out Xml
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
file: ./tty-fwd/cobertura.xml
flags: rust
name: rust-coverage