Skip to content

Commit

Permalink
build: more CI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Halbronn committed May 16, 2024
1 parent ba8910f commit bd34a1e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ jobs:
# if: runner.os == 'Linux'
# - run: pnpm --color test
# if: runner.os != 'Linux'
- name: Checkout themis.vim
uses: actions/checkout@v4
with:
repository: thinca/vim-themis
path: vim-themis
# XXX: delete this because it doesn't work
# - name: Checkout themis.vim
# uses: actions/checkout@v4
# with:
# repository: thinca/vim-themis
# path: vim-themis
# testing
- run: pwd
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
id: vim
Expand Down
27 changes: 27 additions & 0 deletions packages/test-harness/src/config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- [[ Install `lazy.nvim` plugin manager ]]
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
-- production cursorless.nvim
'hands-free-vim/cursorless.nvim',

'vim-scripts/BufOnly.vim',
})

-- vim.o.runtimepath = vim.o.runtimepath .. "," .. "C:\\path\\cursorless\\dist\\cursorless.nvim"

require('talon').setup()
require('cursorless').setup()
22 changes: 18 additions & 4 deletions packages/test-harness/src/launchNeovimAndRunTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function delay(ms: number) {
* `--extensionTestsPath`
*/
export async function launchNeovimAndRunTests(extensionTestsPath: string) {
let code = 1; // failure
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
Expand All @@ -45,6 +46,7 @@ export async function launchNeovimAndRunTests(extensionTestsPath: string) {
// const [cli, ...args] =
// resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
let cli = getEnvironmentVariableStrict("APP_PATH");
// Installed executable: C:\Users\runneradmin\nvim-stable\bin\nvim.exe
cli = cli.replace("nvim.exe", "nvim-qt.exe");

// Install extension dependencies
Expand All @@ -68,8 +70,21 @@ export async function launchNeovimAndRunTests(extensionTestsPath: string) {
const nvim_process = cp.spawn(cli, [], {
// encoding: "utf-8",
// stdio: "inherit",
env: {
...process.env,
CURSORLESS_REPO_ROOT: "${workspaceFolder}",
// "NVIM_NODE_HOST_DEBUG": "1",
NVIM_NODE_LOG_FILE:
"${workspaceFolder}/packages/cursorless-neovim/out/nvim_node.log",
NVIM_NODE_LOG_LEVEL: "debug",
CURSORLESS_MODE: "test",
},
});

// C:\Users\user\AppData\Local\nvim\init.lua
// C:\Users\user\AppData\Local\nvim-data\lazy\{cursorless.nvim,lazy.nvim,talon.nvim}
// C:\Users\user\AppData\Local\nvim-data\log

// do not wait for nvim to exit to avoid any blocking
nvim_process.unref();

Expand Down Expand Up @@ -100,12 +115,11 @@ export async function launchNeovimAndRunTests(extensionTestsPath: string) {
// ? undefined
// : [`--crash-reporter-directory=${crashDir}`, `--logsPath=${logsDir}`],
// });
const code = 0;

console.log(`Returned from "runTests" with value: ${code}`);
code = 0; // success
} catch (err) {
console.error("Test run threw exception:");
console.error(err);
process.exit(1);
}
console.log(`Returned code: ${code}`);
process.exit(code);
}

0 comments on commit bd34a1e

Please sign in to comment.