rust-analyzer-mcp 0.3.1

MCP server for rust-analyzer integration
Documentation
name: Lint, Build and Test

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  fmt:
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: -D warnings
      RUST_BACKTRACE: full
      RUST_LOG: trace
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          # We use some nightly fmt options.
          toolchain: nightly
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      - name: Check formatting
        run: |
          cargo --locked fmt -- --check

  clippy:
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: -D warnings
      RUST_BACKTRACE: full
      RUST_LOG: trace
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - name: Catch common mistakes and unwrap calls
        run: |
          cargo --locked clippy -- -D warnings

  test:
    runs-on: ubuntu-latest
    needs: [fmt, clippy]
    env:
      RUSTFLAGS: -D warnings
      RUST_BACKTRACE: full
      RUST_LOG: trace
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          components: rust-analyzer
      - uses: Swatinem/rust-cache@v2
      - name: Build and Test
        run: |
          cargo test --locked --workspace --release --all-features
      # The test daemons log to these files, rust-analyzer's own stderr included; they are the
      # only trace of why a daemon's rust-analyzer died.
      - name: Upload the test daemons' logs
        if: failure()
        uses: actions/upload-artifact@v7
        with:
          name: test-daemon-logs
          path: /tmp/rust-analyzer-mcp-sockets/*.log*
          if-no-files-found: ignore
          retention-days: 14