algocline 0.46.1

LLM amplification engine — MCP server with Lua scripting
name: CI

on:
  push:
    branches: ['**']
  pull_request:
  workflow_dispatch:

env:
  INSTA_UPDATE: 'no'

jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@stable

      - uses: Swatinem/rust-cache@v2

      - uses: taiki-e/install-action@v2
        with:
          tool: just

      - name: Install stylua 2.3.1 (pinned)
        # `lua54` feature enables Lua 5.3+ parser (bitwise `>>` / `&`, `goto`
        # label). stylua's default features omit it, so `cargo install stylua`
        # ships a Lua 5.1-only parser and fails on prod Lua sources here.
        run: cargo install --locked --version 2.3.1 --features lua54 stylua

      - name: Configure git identity
        # Several e2e tests (test_alc_card_publish_*) create git commits via
        # `alc_card_publish`; the CI runner has no default `user.name` /
        # `user.email` and `git commit` fails with "Author identity unknown".
        run: |
          git config --global user.email "ci@algocline.local"
          git config --global user.name "algocline-ci"

      - name: Bootstrap ~/.algocline/packages via alc init
        # `test_alc_card_analyze_roundtrip` (and other card e2e tests) treat
        # `$HOME/.algocline/packages` as a Collection root that must contain
        # the bundled `card_analysis` package. The developer laptop has this
        # populated by prior `alc init`; the CI runner does not, so we run
        # init explicitly before the test suite.
        run: cargo run --bin alc -- init

      - name: Install bundled scenarios for eval_integration_spec
        # `crates/algocline-engine/tests/lua/eval_integration_test.lua` uses
        # `alc.eval("math_basic", ...)` which resolves via
        # `~/.algocline/scenarios/math_basic.lua`. `alc init` only installs
        # `packages/`; scenarios are userland (populated on the laptop via
        # `alc_scenario_install` at some point) and CI must mirror that by
        # copying the bundled scenarios from the same repo alc init pulls.
        # Tag is kept in sync with `BUNDLED_SOURCES` in src/init.rs.
        run: |
          mkdir -p ~/.algocline/scenarios
          git clone --depth 1 --branch v0.29.1 https://github.com/ynishi/algocline-bundled-packages /tmp/alc-bundled
          cp /tmp/alc-bundled/scenarios/*.lua ~/.algocline/scenarios/
          rm -rf /tmp/alc-bundled

      - name: Run CI checks
        run: just ci

      - name: Upload insta snap.new on failure
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: insta-snap-new
          path: '**/*.snap.new'
          if-no-files-found: ignore