b922f0d612
Expose the init_options payload builders publicly in both clients
(M.init_options/M.server_settings in Lua, nuwiki#lsp#settings() in Vim) so
they can be inspected. Add editor harnesses that dump each client's
server-bound config as deterministic key=value lines and diff against a
shared golden file: nvim == golden and vim == golden together prove the two
clients send identical config. Add a server-side test asserting the Vim flat
shape and the Neovim {nuwiki:{...}} wrapper desugar to the same WikiConfig.
Wire both harnesses into CI.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
103 lines
3.2 KiB
YAML
103 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: short
|
|
RUSTFLAGS: -D warnings
|
|
|
|
jobs:
|
|
fmt:
|
|
name: cargo fmt --check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.83
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: cargo clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.83
|
|
with:
|
|
components: clippy
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-clippy-
|
|
- run: cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
test:
|
|
name: cargo test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.83
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-test-
|
|
- run: cargo test --workspace --all-targets
|
|
|
|
keymaps:
|
|
name: editor keymaps
|
|
runs-on: ubuntu-latest
|
|
# Serialise behind the cargo jobs so we never compete with them
|
|
# for runners, and inherit their warm cargo cache instead of
|
|
# forcing a release build of our own.
|
|
needs: test
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.83
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-test-
|
|
- name: install Neovim 0.11 + Vim
|
|
run: |
|
|
set -euo pipefail
|
|
# Apt's neovim is too old (Ubuntu LTS ships 0.6/0.7), missing
|
|
# `vim.lsp.get_clients` and rejecting `@group.modifier`
|
|
# highlight names. Pull the official static tarball instead.
|
|
NVIM_VER=v0.11.3
|
|
curl -fsSL -o /tmp/nvim.tar.gz \
|
|
"https://github.com/neovim/neovim/releases/download/${NVIM_VER}/nvim-linux-x86_64.tar.gz"
|
|
sudo tar -xzf /tmp/nvim.tar.gz -C /opt
|
|
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim
|
|
nvim --version | head -1
|
|
# Vim from apt is fine — only the pure-VimL keymaps run there.
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y --no-install-recommends vim
|
|
vim --version | head -1
|
|
- name: run Neovim keymap harness
|
|
run: ./development/tests/test-keymaps.sh
|
|
- name: run Vim keymap harness
|
|
run: ./development/tests/test-keymaps-vim.sh
|
|
- name: run Neovim config parity harness
|
|
run: ./development/tests/test-config.sh
|
|
- name: run Vim config parity harness
|
|
run: ./development/tests/test-config-vim.sh
|