Neovim CI tests #10160
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: target all platforms? | |
# os: [macos-latest, ubuntu-latest, windows-latest] | |
os: [ubuntu-latest] | |
# XXX: target all app versions? | |
# NB: stable: is 0.10.0 and only has nvim.exe (no nvim-qt.exe) | |
# 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: target all node versions? | |
# NB: 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: there is no concept of "legacy" in neovim but maybe "v0.9.5" would fit the bill? | |
# 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 - use same v20.12.1 taken from .nvmrc file? | |
# node-version-file: .nvmrc | |
# node-version: v21.7.1 | |
node-version: ${{ matrix.node_version }} | |
cache: pnpm | |
- run: mkdir -p "${{ env.APP_CRASH_DIR }}" "${{ env.APP_LOGS_DIR }}" | |
shell: bash | |
- run: pnpm --color install | |
- run: pnpm --color compile | |
- run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build | |
# XXX - restore this once neovim tests work in CI | |
#- run: xvfb-run -a pnpm --color test | |
# if: runner.os == 'Linux' | |
# - run: pnpm --color test | |
# if: runner.os != 'Linux' | |
# XXX - debugging only, remove once tests work on all platforms | |
- 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' | |
# XXX - is there a better way to execute all these commands? | |
- name: Install cursorless.nvim dependencies | |
run: npm install -g neovim@5.1.0 | |
- 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' | |
- name: Install Neovim | |
uses: rhysd/action-setup-vim@v1 | |
id: vim | |
with: | |
version: ${{ matrix.app_version }} | |
neovim: true | |
- 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 }} | |
# XXX: restore this once neovim tests work in CI | |
# - 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' | |
# - 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() |