name: Tests

on:
    push:
        branches:
            - "main"
    pull_request:

jobs:
    tests:
        strategy:
            fail-fast: false
            matrix:
                nvim_version:
                    - v0.7.0
                    - v0.7.2
                    - v0.8.0
                    - v0.8.1
                    - v0.8.2
                    - v0.8.3
                    - v0.9.0
                    - v0.9.1
                    - v0.9.2
                    - v0.9.4
                    - v0.9.5
                    - v0.10.0
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v4
            - uses: rhysd/action-setup-vim@v1
              with:
                  neovim: true
                  version: ${{ matrix.nvim_version }}
            - name: Run tests
              run: |
                set -e
                make test
                nvim -u NONE -E -R --headless +'helptags doc' +q
