Files
nuwiki/.gitea/workflows/ci.yaml
T
gffranco 87ba4c1764
CI / cargo fmt --check (push) Successful in 26s
CI / cargo clippy (push) Successful in 27s
CI / cargo test (push) Successful in 31s
CI / editor keymaps (push) Successful in 1m30s
test(calendar): add Vim + Neovim integration harnesses
Add headless harnesses covering the calendar-vim integration, wired into
CI alongside the existing keymap/config suites:

- test-calendar-vim.sh/.vim (+ -optout.vim): pure-VimL diary hooks
  (calendar_sign markers, calendar_action path resolution from wiki root,
  calendar window close), plugin/nuwiki.vim hook auto-wiring that
  overrides calendar-vim's defaults, and opt-out via g:nuwiki_use_calendar
  and g:nuwiki_no_calendar. Uses a stub calendar-vim on the runtimepath.
- test-calendar.sh/.lua: Neovim setup() wiring + window-close under the
  real window API, and opt-out via use_calendar = false.

Fixes surfaced by the suite:
- diary.vim: new diary entries set filetype 'vimwiki' (was the raw
  extension, e.g. 'wiki'); the stray FileType autocmd also blocked the
  calendar window from closing.
- init.lua: drop the redundant Neovim FileType autocmd (plugin/nuwiki.vim
  already wires both editors) and translate use_calendar=false into
  g:nuwiki_no_calendar so the opt-out actually disables wiring.
2026-05-31 21:45:50 -03:00

107 lines
3.4 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
- name: run Neovim calendar integration harness
run: ./development/tests/test-calendar.sh
- name: run Vim calendar integration harness
run: ./development/tests/test-calendar-vim.sh