d188b09fde
CI improvements: - Add concurrency group to cancel redundant runs on same branch - Add cargo cache to fmt job (was missing entirely) - Add timeout-minutes: 5 to fast jobs (fmt, clippy, test) for fail-fast - Change RUST_BACKTRACE from 'short' to '1' for better CI debuggability - Pin push trigger to branches: [main] to avoid double-firing on PR merges - Test minimum supported Neovim (0.11.0) instead of latest patch (0.11.3) Release improvements: - Enforce RUSTFLAGS: -D warnings at env level and in matrix rustflags - Remove redundant checkout in release job (only needs env vars) - Add release notes generation from git log since previous tag - Make release creation idempotent (check if release exists before creating) - Fix release_id not being set when release already exists
127 lines
4.0 KiB
YAML
127 lines
4.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: "1"
|
|
RUSTFLAGS: -D warnings
|
|
|
|
jobs:
|
|
fmt:
|
|
name: cargo fmt --check
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@1.83
|
|
with:
|
|
components: rustfmt
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-fmt-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
|
restore-keys:
|
|
- ${{ runner.os }}-cargo-fmt-
|
|
- run: cargo fmt --all -- --check
|
|
|
|
clippy:
|
|
name: cargo clippy
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
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
|
|
timeout-minutes: 5
|
|
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 + Vim
|
|
run: |
|
|
set -euo pipefail
|
|
# Test the minimum supported Neovim version (0.11.0) so we
|
|
# catch API regressions at the bottom of the supported range.
|
|
# Pinning to a specific patch version; bump when 0.12 ships.
|
|
NVIM_VER=v0.11.0
|
|
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
|
|
- name: run Vim vars-shim harness
|
|
run: ./development/tests/test-vars-vim.sh
|