Skip to content

nvim/lua/plugins/{coverage,movement}.lua: add nvim-coverage for showi… #61

nvim/lua/plugins/{coverage,movement}.lua: add nvim-coverage for showi…

nvim/lua/plugins/{coverage,movement}.lua: add nvim-coverage for showi… #61

Workflow file for this run

---
name: Build and test
on:
push:
workflow_dispatch:
env:
# The version of caching we are using. This can be upgraded if we
# significantly change CI to the point where old caches become irrelevant.
CACHE_VERSION: 0
# Default Python version. Jazzy defaults to 3.12.
DEFAULT_PYTHON: 3.12
# Location of the pre-commit cache. This is set by pre-commit, not us!
PRE_COMMIT_CACHE: ~/.cache/pre-commit
# Maximum acceptable Neovim startup time in milliseconds
MAX_NVIM_STARTUP_TIME_MS: 140
# Cancels this run if a new one referring to the same object and same workflow
# is requested
concurrency:
group: >
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "pip"
- name: Install pre-commit hooks
run: |
python --version
pip install "$(grep pre-commit requirements.txt)"
- name: Generate pre-commit cache key
id: pre-commit_cache_key
run: >
echo "key=${{ env.CACHE_VERSION }}-${{ env.DEFAULT_PYTHON }}-${{
hashFiles('.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
- name: Restore base pre-commit environment
id: cache-pre-commit
uses: actions/cache@v4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >
${{ runner.os
}}-pre-commit-${{ steps.pre-commit_cache_key.outputs.key }}
- name: Install pre-commit dependencies if no cache
if: steps.cache-pre-commit.outputs.cache-hit != 'true'
run: |
pre-commit install-hooks
- name: Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
nvim-tests:
name: Run Neovim tests
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
nvim_version:
- stable
experimental: [false]
# Nightly builds should not fail job
include:
- os: ubuntu-latest
nvim_version: nightly
experimental: true
- os: macos-latest
nvim_version: nightly
experimental: true
runs-on: ${{ matrix.os }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4
with:
submodules: recursive
- name: Copy config
run: |
cp -r ${{ github.workspace }}/nvim/ ~/.config/nvim/
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.nvim_version }}
- name: Install dependencies
run: |
# For some reason, on Linux, this command may segfault on the first try -
# if so, just run it again (it usually works the second time).
nvim --headless "+Lazy! sync" +qa || nvim --headless "+Lazy! sync" +qa
- name: Test startup time
run: |
nvim --startuptime startuptime.log --headless +qa
cat startuptime.log
- name: Verify startup time is less than ${{ env.MAX_NVIM_STARTUP_TIME_MS }}ms
run: |
TOTAL_TIME_MS=$(tail -2 startuptime.log | head -1 | awk '{print $1}')
if [[ "$TOTAL_TIME_MS" > "${{ env.MAX_NVIM_STARTUP_TIME_MS }}" ]]; then
echo "neovim startup time ${TOTAL_TIME_MS}ms exceeds maximum of ${{ env.MAX_NVIM_STARTUP_TIME_MS }}ms"
exit 1
else
echo "neovim startup time ${TOTAL_TIME_MS}ms is within acceptable limits"
fi
# This healthcheck ensures that there are no overlapping keymaps
# - name: which_key healthcheck
# run: |
# nvim --headless -c "