name: test

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        editor: [nvim, vim]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - name: Install dependencies
        run: npm ci
      - name: Install Vim and Neovim
        run: |
          sudo apt-get update
          sudo apt-get install -y vim neovim
      - name: Run integration tests
        run: npx --no-install coc-test --${{ matrix.editor }} 'test/**/*.test.ts'
