cairo-language-server 2.20.0

The Cairo Language Server
Documentation
name: CI

on:
  push:
    branches:
      - main
      - release/*
  pull_request:
  merge_group:

concurrency:
  group: ${{ github.head_ref || github.run_id }}
  cancel-in-progress: ${{ github.head_ref != 'main' }}

jobs:
  build-test:
    name: build tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: taiki-e/install-action@v2
        with:
          tool: nextest@0.9.98
      - name: nextest archive
        run: cargo nextest archive --workspace --all-features --cargo-profile ci --archive-file 'nextest-archive.tar.zst'
      - uses: actions/upload-artifact@v7
        with:
          name: nextest-archive
          path: nextest-archive.tar.zst

  test:
    name: test ${{ matrix.partition }}/6
    runs-on: ubuntu-latest
    needs:
      - build-test
    strategy:
      fail-fast: false
      matrix:
        partition: [ 1, 2, 3, 4, 5, 6 ]
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: software-mansion/setup-scarb@v1
        with:
          cache: false
      # For debugger lens tests.
      - uses: foundry-rs/setup-snfoundry@v6
        with:
          starknet-foundry-version: nightly-2026-04-06
      - uses: taiki-e/install-action@v2
        with:
          tool: nextest@0.9.98
      - uses: actions/download-artifact@v8
        with:
          name: nextest-archive
      - name: nextest partition ${{ matrix.partition }}/6
        run: cargo nextest run --profile ci --partition 'count:${{ matrix.partition }}/6' --archive-file 'nextest-archive.tar.zst'

  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@nightly
        with:
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --check

  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo lint
        env:
          # Make sure CI fails on all warnings, including Clippy lints.
          RUSTFLAGS: "-Dwarnings"
      - run: cargo docs
        env:
          # Make sure CI fails on all warnings, including Clippy lints.
          RUSTDOCFLAGS: "-Dwarnings"
      - name: Check unused cargo patches
        run: |
          if grep -q '^\[\[patch\.unused\]\]' Cargo.lock; then
            grep -A 2 '^\[\[patch\.unused\]\]' Cargo.lock
            echo "::error::Found unused cargo patches in [patch.crates-io]."
            exit 1
          fi
      - uses: taiki-e/install-action@cargo-machete
      - run: cargo machete