tokensave 6.3.2

Code intelligence tool that builds a semantic knowledge graph from Rust, Go, Java, Scala, TypeScript, Python, C, C++, Kotlin, C#, Swift, and many more codebases
name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test ${{ matrix.name }}
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Linux
            runner: ubuntu-latest
          - name: macOS
            runner: macos-14
          - name: Windows
            runner: windows-latest

    steps:
      - uses: actions/checkout@v4

      # The Linux runner ships with ~10 GB free, which our 713 MB cache restore
      # plus the cargo target dir (34 tree-sitter parsers compiled in) can
      # exceed. See v4.5.1 CI flake: "No space left on device" mid-test.
      - name: Free disk space (Linux only)
        if: matrix.name == 'Linux'
        uses: jlumbroso/free-disk-space@v1.3.1
        with:
          tool-cache: false
          android: true
          dotnet: true
          haskell: true
          large-packages: false
          swap-storage: false

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: v1-rust-test

      - name: Run tests
        run: cargo test --workspace

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    continue-on-error: true
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --workspace --all-targets

  fmt:
    name: Format
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all -- --check