meebis 0.15.0

A fast, disposable, in-memory Redis-compatible server for ephemeral dev work
name: CI

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    name: Test & Redis-spec compatibility
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2

      - name: Format
        run: cargo fmt --all -- --check

      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings

      - name: Unit tests
        run: cargo test --all

      - name: Build release
        run: cargo build --release

      # The compatibility suite diffs meebis against the real Redis server,
      # command-for-command, so a regression against the Redis spec fails CI.
      # Pin the reference to Redis 7.2 rather than apt's 7.0.x: OBJECT ENCODING
      # for lists is version-sensitive (small lists report `listpack` on 7.2+
      # but `quicklist` on 7.0), and meebis targets the modern 7.2 encodings.
      - name: Install reference Redis
        uses: shogo82148/actions-setup-redis@v1
        with:
          redis-version: '7.2'
          auto-start: 'false'

      - name: Set up Python (for the RESP3 parity check)
        uses: actions/setup-python@v5
        with:
          python-version: '3.x'

      - name: Install redis-py
        run: pip install redis

      - name: Redis compatibility suite
        run: bash tests/compat/run.sh ./target/release/meebis

      # The Claude Code plugin's hooks are shell, so nothing else in the build
      # would notice them breaking. This drives them the way Claude Code does —
      # the script from hooks.json, the event JSON on stdin — against the
      # binary just built.
      - name: Claude Code plugin hooks
        run: bash claude-code/test-hooks.sh ./target/release/meebis

      # Runs the direnv recipe extracted from README.md itself, so the
      # documented snippet cannot rot into something that does not work.
      - name: direnv recipe
        run: bash tests/envrc-recipe.sh ./target/release/meebis

      # The asdf plugin in bin/ installs published release assets, so it can
      # break without anything in this repo changing — a rename in the release
      # layout would only show up here.
      - name: asdf plugin
        run: bash tests/asdf-plugin.sh

  # The devcontainer feature installs published release assets into other
  # people's images, so nothing in the cargo build would notice it breaking.
  devcontainer:
    name: Devcontainer feature
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Feature tests
        run: >
          npx --yes @devcontainers/cli@latest features test
          --project-folder devcontainer
          --features meebis
          --base-image mcr.microsoft.com/devcontainers/base:debian

      # The harness above cannot cover unsupported bases: a feature that fails
      # to install fails the image build, so there is no container left to
      # assert in. This checks those refusals name their reason.
      - name: Base image matrix
        run: bash devcontainer/test-bases.sh