Skip to content

Neovim CI tests

Neovim CI tests #10147

Workflow file for this run

name: Run Tests
permissions: read-all
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
merge_group:
branches: [main]
jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
# XXX: restore this once neovim tests work in CI
# os: [macos-latest, ubuntu-latest, windows-latest]
#os: [windows-latest]
os: [ubuntu-latest]
# os: [macos-latest, ubuntu-latest, windows-latest]
# XXX - stable is 0.10.0 and only has nvim.exe (no nvim-qt.exe). Also locally it hangs on unskipped test
# and on CI, it fails on trying to tail the log and I don't know what is happening since didnt get a snapshot of CI yet
# to understand the error in nvim.exe (though probably need the nvim-qt.exe since nvim.exe won't show anything)
# Linux: with 0.9.5 or stable, it hangs on first function call back into lua from node
# app_version: [stable]
#app_version: [v0.9.5]
# NB: Nightly is NVIM v0.11.0-dev-25+g0e187fe03 in May 2024
# app_version: [v0.9.5, v0.10.0, stable, nightly]
app_version: [v0.10.0]
# XXX error while downloading v16.20.2, v17.9.1 on macos/ubuntu at least
# node_version: [v18.20.2, v19.9.0, v20.13.1, v21.7.3, v22.2.0]
node_version: [v18.20.2]
# XXX: restore this once neovim tests work in CI
# include:
# - os: ubuntu-latest
# app_version: legacy
runs-on: ${{ matrix.os }}
env:
APP_VERSION: ${{ matrix.app_version }}
APP_CRASH_DIR: ${{ github.workspace }}/artifacts/dumps
APP_LOGS_DIR: ${{ github.workspace }}/artifacts/logs
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- run: corepack enable
# XXX - run over different node versions: https://nodejs.org/en/about/previous-releases
- uses: actions/setup-node@v4
with:
# XXX - v20.12.1 taken from .nvmrc file?
# node-version-file: .nvmrc
node-version: ${{ matrix.node_version }}
# node-version: v21.7.1
cache: pnpm
# XXX testing only
# - run: dir ${{ github.workspace }}
# - run: dir ${{ github.workspace }}/packages
# - run: dir ${{ github.workspace }}/packages/test-harness
- run: mkdir -p "${{ env.APP_CRASH_DIR }}" "${{ env.APP_LOGS_DIR }}"
shell: bash
# NB: we can't comment this for speeding up testing as we get this error when running test harness:
# > @cursorless/[email protected] testNeovim D:\a\cursorless\cursorless\packages\test-harness
# > env CURSORLESS_MODE=test my-ts-node src/scripts/runNeovimTestsCI.ts
# env: 'my-ts-node': No such file or directory
# D:\a\cursorless\cursorless\packages\test-harness:
#  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @cursorless/[email protected] testNeovim: `env CURSORLESS_MODE=test my-ts-node src/scripts/runNeovimTestsCI.ts`
# spawn ENOENT
#  WARN  Local package.json exists, but node_modules missing, did you mean to install?
# Error: Process completed with exit code 1.
- run: pnpm --color install
- run: pnpm --color compile
#- run: dir D:\a\cursorless\cursorless\packages\cursorless-neovim\out\
# We need to run "build" in order to prepare the dist/cursorless.nvim folder
- run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build
#- run: xvfb-run -a pnpm --color test
# if: runner.os == 'Linux'
# - run: pnpm --color test
# if: runner.os != 'Linux'
# Current working directory:
# - Windows: D:\a\cursorless\cursorless
# - Linux: /home/runner/work/cursorless/cursorless
# - OS X: /Users/runner/work/cursorless/cursorless
- run: pwd
- run: tree /home/runner/work/cursorless/cursorless/dist
if: runner.os == 'Linux'
- run: tree /f D:\a\cursorless\cursorless\dist
if: runner.os == 'Windows'
- run: find /Users/runner/work/cursorless/cursorless/dist
if: runner.os == 'macOS'
# - run: dir
#- run: dir C:\Users\runneradmin\AppData\Local
# Directory: C:\Users\runneradmin\AppData\Local
# Mode LastWriteTime Length Name
# ---- ------------- ------ ----
# d---- 5/15/2024 11:25 PM .IdentityService
# d---- 5/15/2024 11:24 PM AzureFunctionsTools
# d---- 5/16/2024 11:19 AM GitHub
# d---- 5/15/2024 11:13 PM Google
# d---- 5/16/2024 11:13 AM Microsoft
# d---- 5/15/2024 11:17 PM Microsoft SDKs
# d---- 5/16/2024 11:14 AM Mozilla
# d---- 5/16/2024 11:20 AM node
# d---- 5/15/2024 11:13 PM Packages
# d---- 5/15/2024 11:14 PM PeerDistRepub
# d---- 5/16/2024 11:20 AM pnpm
# d---- 5/15/2024 11:17 PM ServiceHub
# d---- 5/16/2024 11:21 AM Temp
- name: Install cursorless.nvim dependencies
run: npm install -g [email protected]
- run: git clone https://github.com/vim-scripts/BufOnly.vim /home/runner/BufOnly.vim
if: runner.os == 'Linux'
- run: git clone https://github.com/hands-free-vim/talon.nvim /home/runner/talon.nvim
if: runner.os == 'Linux'
- run: git clone https://github.com/MunifTanjim/nui.nvim /home/runner/nui.nvim
if: runner.os == 'Linux'
- run: git clone https://github.com/folke/noice.nvim /home/runner/noice.nvim
if: runner.os == 'Linux'
- run: git clone https://github.com/vim-scripts/BufOnly.vim C:\Users\runneradmin\BufOnly.vim
if: runner.os == 'Windows'
- run: git clone https://github.com/hands-free-vim/talon.nvim C:\Users\runneradmin\talon.nvim
if: runner.os == 'Windows'
- run: git clone https://github.com/vim-scripts/BufOnly.vim /Users/runner//BufOnly.vim
if: runner.os == 'macOS'
- run: git clone https://github.com/hands-free-vim/talon.nvim /Users/runner//talon.nvim
if: runner.os == 'macOS'
# - run: C:\Users\runneradmin\nvim-stable\bin\nvim.exe -l ${{ github.workspace }}\packages\test-harness\src\config\empty.lua
# C:\Users\runneradmin\nvim-stable\bin\nvim.exe: D:\a\_temp\2658188c-43d2-4fce-9de9-299408299ebb.ps1:2
# Line |
# 2 | C:\Users\runneradmin\nvim-stable\bin\nvim.exe -l D:\a\cursorless\curs …
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | The term 'C:\Users\runneradmin\nvim-stable\bin\nvim.exe' is not recognized as a name of a cmdlet, function,
# | script file, or executable program. Check the spelling of the name, or if a path was included, verify that the
# | path is correct and try again.
# Error: Process completed with exit code 1.
#- run: mkdir C:\Users\runneradmin\AppData\Local\nvim
# Run rhysd/action-setup-vim@v1 fails with "app_version: legacy"
# Error: 'version' input 'legacy' is not a format of Git tags in neovim/neovim repository. It should match to regex //^v\d+\.\d+\.\d+$//. NOTE: It requires 'v' prefix
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
id: vim
with:
version: ${{ matrix.app_version }}
neovim: true
# - run: dir /home/runner/.local/share/ || true
# - run: dir /home/runner/.local/share/nvim/ || true
# - run: dir /home/runner/.config/ || true
# - run: dir /home/runner/.config/nvim/ || true
# - run: ${{ steps.vim.outputs.executable }} -l ${{ github.workspace }}/packages/test-harness/src/config/empty.lua
# - run: dir /home/runner/.local/share/ || true
# - run: dir /home/runner/.local/share/nvim/ || true
# - run: dir /home/runner/.config/ || true
# - run: dir /home/runner/.config/nvim/ || true
#- run: dir C:\Users\runneradmin\
#- run: dir C:\Users\runneradmin\nvim-${{ matrix.app_version }}\bin\
# Run dir C:\Users\runneradmin\nvim-v0.9.5\bin\
# Directory: C:\Users\runneradmin\nvim-v0.9.5\bin
# Mode LastWriteTime Length Name
# ---- ------------- ------ ----
# d---- 12/30/2023 1:22 PM bearer
# d---- 12/30/2023 1:22 PM iconengines
# d---- 12/30/2023 1:22 PM imageformats
# d---- 12/30/2023 1:22 PM platforms
# d---- 12/30/2023 1:22 PM styles
# d---- 12/30/2023 1:22 PM translations
# -a--- 12/30/2023 1:20 PM 16384 cat.exe
# -a--- 12/30/2023 1:20 PM 4173928 D3Dcompiler_47.dll
# -a--- 12/30/2023 1:22 PM 1199296 dbghelp.dll
# -a--- 12/30/2023 1:20 PM 68096 diff.exe
# -a--- 12/30/2023 1:20 PM 69088 libEGL.dll
# -a--- 12/30/2023 1:20 PM 76288 libgcc_s_seh-1.dll
# -a--- 12/30/2023 1:20 PM 6298808 libGLESv2.dll
# -a--- 12/30/2023 1:20 PM 1417216 libstdc++-6.dll
# -a--- 12/30/2023 1:20 PM 52224 libwinpthread-1.dll
# -a--- 12/30/2023 1:22 PM 539648 lua51.dll
# -a--- 12/30/2023 1:20 PM 3757746 nvim-qt.exe
# -a--- 12/30/2023 1:22 PM 5214720 nvim.exe
# -a--- 12/30/2023 1:22 PM 13242368 nvim.pdb
# -a--- 12/30/2023 1:20 PM 20923392 opengl32sw.dll
# -a--- 12/30/2023 1:20 PM 8185968 Qt5Core.dll
# -a--- 12/30/2023 1:20 PM 9663232 Qt5Gui.dll
# -a--- 12/30/2023 1:20 PM 2699096 Qt5Network.dll
# -a--- 12/30/2023 1:20 PM 580088 Qt5Svg.dll
# -a--- 12/30/2023 1:20 PM 8662160 Qt5Widgets.dll
# -a--- 12/30/2023 1:20 PM 131072 tee.exe
# -a--- 12/30/2023 1:20 PM 1137152 win32yank.exe
# -a--- 12/30/2023 1:20 PM 151040
- name: Run neovim unit tests using test-harness
run: pnpm -F @cursorless/test-harness testNeovim
if: runner.os != 'Linux'
env:
APP_PATH: ${{ steps.vim.outputs.executable }}
- run: xvfb-run -a pnpm -F @cursorless/test-harness testNeovim
if: runner.os == 'Linux'
env:
APP_PATH: ${{ steps.vim.outputs.executable }}
#- name: Create vscode dist that can be installed locally
# run: pnpm -F @cursorless/cursorless-vscode populate-dist --local-install
# if: runner.os == 'Linux' && matrix.app_version == 'stable'
# XXX: restore this once neovim tests work in CI
# - name: Test create vsix
# id: createVsix
# uses: HaaLeo/publish-vscode-extension@v1
# with:
# pat: none
# packagePath: packages/cursorless-vscode/dist
# dryRun: true
# - run: mv ${{ steps.createVsix.outputs.vsixPath }} cursorless-development.vsix
# if: runner.os == 'Linux' && matrix.app_version == 'stable'
# - name: Upload vsix
# uses: actions/upload-artifact@v4
# if: runner.os == 'Linux' && matrix.app_version == 'stable'
# with:
# name: vsix
# path: cursorless-development.vsix
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs
path: ${{ env.APP_LOGS_DIR }}
if: failure()
- name: Archive dumps
uses: actions/upload-artifact@v4
with:
name: dumps
path: ${{ env.APP_CRASH_DIR }}
if: failure()