-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌿 Add tests for Vim script #314
Conversation
WalkthroughThe changes introduce a comprehensive testing suite for Vim and Neovim configurations using GitHub Actions and the Themis testing framework. The testing not only includes linting and formatting checks but also ensures the proper functioning of Vim script plugins across various environments. This setup is crucial for maintaining the quality and stability of the Vim scripting components in the project. Changes
Related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #314 +/- ##
=======================================
Coverage 96.47% 96.47%
=======================================
Files 3 3
Lines 85 85
Branches 6 6
=======================================
Hits 82 82
Misses 3 3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files selected for processing (5)
- .github/workflows/test_vim.yml (1 hunks)
- test/.themisrc (1 hunks)
- test/denops/plugin.vimspec (1 hunks)
- test/denops/testdata/dummy.ts (1 hunks)
- test/run_themis.sh (1 hunks)
Additional comments: 1
test/denops/testdata/dummy.ts (1)
- 1-1: The
main
function is currently empty. If this is intended to be a placeholder or mock for testing, then the changes look good.
#!/bin/bash | ||
themis --version | ||
|
||
export THEMIS_VIM="vim" | ||
themis --reporter dot | ||
|
||
export THEMIS_VIM="nvim" | ||
export THEMIS_ARGS="-e -s --headless" | ||
themis --reporter dot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is well-structured and sets up the environment for running Themis tests on both Vim and Neovim. Consider adding comments to explain the purpose of each command for future maintainability.
#!/bin/bash
+ # Display the Themis version for debugging purposes
themis --version
+ # Set Vim as the target editor for Themis and run tests
export THEMIS_VIM="vim"
themis --reporter dot
+ # Set Neovim as the target editor for Themis and run tests in headless mode
export THEMIS_VIM="nvim"
export THEMIS_ARGS="-e -s --headless"
themis --reporter dot
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
#!/bin/bash | |
themis --version | |
export THEMIS_VIM="vim" | |
themis --reporter dot | |
export THEMIS_VIM="nvim" | |
export THEMIS_ARGS="-e -s --headless" | |
themis --reporter dot | |
#!/bin/bash | |
# Display the Themis version for debugging purposes | |
themis --version | |
# Set Vim as the target editor for Themis and run tests | |
export THEMIS_VIM="vim" | |
themis --reporter dot | |
# Set Neovim as the target editor for Themis and run tests in headless mode | |
export THEMIS_VIM="nvim" | |
export THEMIS_ARGS="-e -s --headless" | |
themis --reporter dot |
let s:sep = has('win32') ? '\' : '/' | ||
let s:dummy_index = 0 | ||
|
||
function! Wait(condition) abort | ||
return denops#_internal#wait#for(1000, a:condition, 200) | ||
endfunction | ||
|
||
function! Join(...) abort | ||
return join(a:000, s:sep) | ||
endfunction | ||
|
||
function! GetResourcePath(...) abort | ||
let l:path = join([getcwd()] + a:000, s:sep) | ||
if filereadable(l:path) || isdirectory(l:path) | ||
return l:path | ||
endif | ||
throw 'Resource not found: ' . l:path | ||
endfunction | ||
|
||
function! GetDummyName() abort | ||
let s:dummy_index += 1 | ||
return printf('dummy%d', s:dummy_index) | ||
endfunction | ||
|
||
let s:assert = themis#helper('assert') | ||
call themis#option('recursive', 1) | ||
call themis#helper('command').with(s:assert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The utility functions in .themisrc
are well-defined and serve clear purposes in the testing setup. Consider adding comments to each function to explain their usage and improve maintainability.
let s:sep = has('win32') ? '\' : '/'
+ # Function to wait for a condition to be met with a timeout
function! Wait(condition) abort
return denops#_internal#wait#for(1000, a:condition, 200)
endfunction
+ # Function to join paths using the appropriate OS separator
function! Join(...) abort
return join(a:000, s:sep)
endfunction
+ # Function to get the full path of a resource, throwing an error if not found
function! GetResourcePath(...) abort
let l:path = join([getcwd()] + a:000, s:sep)
if filereadable(l:path) || isdirectory(l:path)
return l:path
endif
throw 'Resource not found: ' . l:path
endfunction
+ # Function to generate a unique dummy name for testing
function! GetDummyName() abort
let s:dummy_index += 1
return printf('dummy%d', s:dummy_index)
endfunction
+ # Setup Themis options and helpers
let s:assert = themis#helper('assert')
call themis#option('recursive', 1)
call themis#helper('command').with(s:assert)
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
let s:sep = has('win32') ? '\' : '/' | |
let s:dummy_index = 0 | |
function! Wait(condition) abort | |
return denops#_internal#wait#for(1000, a:condition, 200) | |
endfunction | |
function! Join(...) abort | |
return join(a:000, s:sep) | |
endfunction | |
function! GetResourcePath(...) abort | |
let l:path = join([getcwd()] + a:000, s:sep) | |
if filereadable(l:path) || isdirectory(l:path) | |
return l:path | |
endif | |
throw 'Resource not found: ' . l:path | |
endfunction | |
function! GetDummyName() abort | |
let s:dummy_index += 1 | |
return printf('dummy%d', s:dummy_index) | |
endfunction | |
let s:assert = themis#helper('assert') | |
call themis#option('recursive', 1) | |
call themis#helper('command').with(s:assert) | |
let s:sep = has('win32') ? '\' : '/' | |
let s:dummy_index = 0 | |
# Function to wait for a condition to be met with a timeout | |
function! Wait(condition) abort | |
return denops#_internal#wait#for(1000, a:condition, 200) | |
endfunction | |
# Function to join paths using the appropriate OS separator | |
function! Join(...) abort | |
return join(a:000, s:sep) | |
endfunction | |
# Function to get the full path of a resource, throwing an error if not found | |
function! GetResourcePath(...) abort | |
let l:path = join([getcwd()] + a:000, s:sep) | |
if filereadable(l:path) || isdirectory(l:path) | |
return l:path | |
endif | |
throw 'Resource not found: ' . l:path | |
endfunction | |
# Function to generate a unique dummy name for testing | |
function! GetDummyName() abort | |
let s:dummy_index += 1 | |
return printf('dummy%d', s:dummy_index) | |
endfunction | |
# Setup Themis options and helpers | |
let s:assert = themis#helper('assert') | |
call themis#option('recursive', 1) | |
call themis#helper('command').with(s:assert) |
let s:dummy_script = GetResourcePath('test', 'denops', 'testdata', 'dummy.ts') | ||
|
||
Describe denops#plugin | ||
Before all | ||
call denops#server#restart() | ||
call denops#server#wait() | ||
End | ||
|
||
Describe #is_loaded() | ||
It returns 0 when the plugins is not registered | ||
let name = GetDummyName() | ||
Assert Equals(denops#plugin#is_loaded(name), 0) | ||
End | ||
|
||
It returns 0 when the plugins is registered but not loaded | ||
let name = GetDummyName() | ||
call denops#plugin#register(name, s:dummy_script) | ||
Assert Equals(denops#plugin#is_loaded(name), 0) | ||
End | ||
|
||
It returns 1 when the plugins is registered and loaded | ||
let name = GetDummyName() | ||
call denops#plugin#register(name, s:dummy_script) | ||
call denops#plugin#wait(name) | ||
Assert Equals(denops#plugin#is_loaded(name), 1) | ||
End | ||
|
||
It returns 0 on DenopsPluginPre:{plugin} autocmd | ||
let name = GetDummyName() | ||
silent! unlet! g:ret | ||
execute printf( | ||
\ 'au User DenopsPluginPre:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | ||
\ name, | ||
\ name, | ||
\) | ||
call denops#plugin#register(name, s:dummy_script) | ||
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | ||
Assert Equals(g:ret, 0) | ||
End | ||
|
||
It returns 1 on DenopsPluginPost:{plugin} autocmd | ||
let name = GetDummyName() | ||
silent! unlet! g:ret | ||
execute printf( | ||
\ 'au User DenopsPluginPost:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | ||
\ name, | ||
\ name, | ||
\) | ||
call denops#plugin#register(name, s:dummy_script) | ||
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | ||
Assert Equals(g:ret, 1) | ||
End | ||
End | ||
End |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test cases in plugin.vimspec
are comprehensive and cover various states of the plugin loading process. Consider adding comments to each test case to explain the expected behavior and improve maintainability.
Describe denops#plugin
+ # Setup and teardown for all test cases in this describe block
Before all
call denops#server#restart()
call denops#server#wait()
End
+ # Test cases for checking if a plugin is loaded
Describe #is_loaded()
+ # Test case when the plugin is not registered
It returns 0 when the plugins is not registered
let name = GetDummyName()
Assert Equals(denops#plugin#is_loaded(name), 0)
End
+ # Test case when the plugin is registered but not loaded
It returns 0 when the plugins is registered but not loaded
let name = GetDummyName()
call denops#plugin#register(name, s:dummy_script)
Assert Equals(denops#plugin#is_loaded(name), 0)
End
+ # Test case when the plugin is registered and loaded
It returns 1 when the plugins is registered and loaded
let name = GetDummyName()
call denops#plugin#register(name, s:dummy_script)
call denops#plugin#wait(name)
Assert Equals(denops#plugin#is_loaded(name), 1)
End
+ # Test case for DenopsPluginPre autocmd event
It returns 0 on DenopsPluginPre:{plugin} autocmd
let name = GetDummyName()
silent! unlet! g:ret
execute printf(
\ 'au User DenopsPluginPre:%s ++once let g:ret = denops#plugin#is_loaded("%s")',
\ name,
\ name,
\)
call denops#plugin#register(name, s:dummy_script)
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0)
Assert Equals(g:ret, 0)
End
+ # Test case for DenopsPluginPost autocmd event
It returns 1 on DenopsPluginPost:{plugin} autocmd
let name = GetDummyName()
silent! unlet! g:ret
execute printf(
\ 'au User DenopsPluginPost:%s ++once let g:ret = denops#plugin#is_loaded("%s")',
\ name,
\ name,
\)
call denops#plugin#register(name, s:dummy_script)
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0)
Assert Equals(g:ret, 1)
End
End
End
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
let s:dummy_script = GetResourcePath('test', 'denops', 'testdata', 'dummy.ts') | |
Describe denops#plugin | |
Before all | |
call denops#server#restart() | |
call denops#server#wait() | |
End | |
Describe #is_loaded() | |
It returns 0 when the plugins is not registered | |
let name = GetDummyName() | |
Assert Equals(denops#plugin#is_loaded(name), 0) | |
End | |
It returns 0 when the plugins is registered but not loaded | |
let name = GetDummyName() | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(denops#plugin#is_loaded(name), 0) | |
End | |
It returns 1 when the plugins is registered and loaded | |
let name = GetDummyName() | |
call denops#plugin#register(name, s:dummy_script) | |
call denops#plugin#wait(name) | |
Assert Equals(denops#plugin#is_loaded(name), 1) | |
End | |
It returns 0 on DenopsPluginPre:{plugin} autocmd | |
let name = GetDummyName() | |
silent! unlet! g:ret | |
execute printf( | |
\ 'au User DenopsPluginPre:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | |
\ name, | |
\ name, | |
\) | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | |
Assert Equals(g:ret, 0) | |
End | |
It returns 1 on DenopsPluginPost:{plugin} autocmd | |
let name = GetDummyName() | |
silent! unlet! g:ret | |
execute printf( | |
\ 'au User DenopsPluginPost:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | |
\ name, | |
\ name, | |
\) | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | |
Assert Equals(g:ret, 1) | |
End | |
End | |
End | |
let s:dummy_script = GetResourcePath('test', 'denops', 'testdata', 'dummy.ts') | |
Describe denops#plugin | |
# Setup and teardown for all test cases in this describe block | |
Before all | |
call denops#server#restart() | |
call denops#server#wait() | |
End | |
# Test cases for checking if a plugin is loaded | |
Describe #is_loaded() | |
# Test case when the plugin is not registered | |
It returns 0 when the plugins is not registered | |
let name = GetDummyName() | |
Assert Equals(denops#plugin#is_loaded(name), 0) | |
End | |
# Test case when the plugin is registered but not loaded | |
It returns 0 when the plugins is registered but not loaded | |
let name = GetDummyName() | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(denops#plugin#is_loaded(name), 0) | |
End | |
# Test case when the plugin is registered and loaded | |
It returns 1 when the plugins is registered and loaded | |
let name = GetDummyName() | |
call denops#plugin#register(name, s:dummy_script) | |
call denops#plugin#wait(name) | |
Assert Equals(denops#plugin#is_loaded(name), 1) | |
End | |
# Test case for DenopsPluginPre autocmd event | |
It returns 0 on DenopsPluginPre:{plugin} autocmd | |
let name = GetDummyName() | |
silent! unlet! g:ret | |
execute printf( | |
\ 'au User DenopsPluginPre:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | |
\ name, | |
\ name, | |
\) | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | |
Assert Equals(g:ret, 0) | |
End | |
# Test case for DenopsPluginPost autocmd event | |
It returns 1 on DenopsPluginPost:{plugin} autocmd | |
let name = GetDummyName() | |
silent! unlet! g:ret | |
execute printf( | |
\ 'au User DenopsPluginPost:%s ++once let g:ret = denops#plugin#is_loaded("%s")', | |
\ name, | |
\ name, | |
\) | |
call denops#plugin#register(name, s:dummy_script) | |
Assert Equals(Wait({ -> has_key(g:, 'ret') }), 0) | |
Assert Equals(g:ret, 1) | |
End | |
End | |
End |
- ".github/workflows/test.yml" | ||
- "deno.jsonc" | ||
|
||
defaults: | ||
run: | ||
shell: bash --noprofile --norc -eo pipefail {0} | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
matrix: | ||
runner: | ||
- ubuntu-latest | ||
version: | ||
- "1.x" | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- run: git config --global core.autocrlf false | ||
if: runner.os == 'Windows' | ||
- uses: actions/checkout@v4 | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: "${{ matrix.version }}" | ||
- name: Lint check | ||
run: deno lint | ||
- name: Format check | ||
run: deno fmt --check | ||
- name: Type check | ||
run: deno task check | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
runner: | ||
- windows-latest | ||
- macos-latest | ||
- ubuntu-latest | ||
version: | ||
- "1.32.x" | ||
- "1.x" | ||
host_version: | ||
- vim: "v9.0.1499" | ||
nvim: "v0.8.0" | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- run: git config --global core.autocrlf false | ||
if: runner.os == 'Windows' | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: thinca/vim-themis | ||
path: vim-themis | ||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: "${{ matrix.version }}" | ||
- uses: rhysd/action-setup-vim@v1 | ||
id: vim | ||
with: | ||
version: "${{ matrix.host_version.vim }}" | ||
- name: Check Vim | ||
run: | | ||
echo ${DENOPS_TEST_VIM} | ||
${DENOPS_TEST_VIM} --version | ||
env: | ||
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }} | ||
- uses: rhysd/action-setup-vim@v1 | ||
id: nvim | ||
with: | ||
neovim: true | ||
version: "${{ matrix.host_version.nvim }}" | ||
- name: Check Neovim | ||
run: | | ||
echo ${DENOPS_TEST_NVIM} | ||
${DENOPS_TEST_NVIM} --version | ||
env: | ||
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }} | ||
- name: Test (Vim) | ||
env: | ||
CI: 1 | ||
THEMIS_VIM: ${{ steps.vim.outputs.executable }} | ||
# XXX: | ||
# Overwrite %TMP% to point a correct temp directory. | ||
# Note that %TMP% only affects value of 'tempname()' in Windows. | ||
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | ||
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | ||
run: | | ||
./vim-themis/bin/themis | ||
timeout-minutes: 5 | ||
- name: Test (Neovim) | ||
env: | ||
CI: 1 | ||
THEMIS_VIM: ${{ steps.nvim.outputs.executable }} | ||
# XXX: | ||
# Overwrite %TMP% to point a correct temp directory. | ||
# Note that %TMP% only affects value of 'tempname()' in Windows. | ||
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | ||
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | ||
run: | | ||
./vim-themis/bin/themis | ||
timeout-minutes: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GitHub Actions workflow is well-structured and covers a comprehensive set of triggers and testing jobs. Consider adding comments to explain the purpose of each job and step for future maintainability.
name: test_vim
+ # Define triggers for the workflow
on:
schedule:
- cron: "0 7 * * 0"
push:
paths:
- "**.md"
- "**.ts"
- "**.vim"
- ".github/workflows/test.yml"
- "deno.jsonc"
pull_request:
paths:
- "**.md"
- "**.ts"
- "**.vim"
- ".github/workflows/test.yml"
- "deno.jsonc"
+ # Define default settings for all jobs
defaults:
run:
shell: bash --noprofile --norc -eo pipefail {0}
+ # Define jobs for linting, formatting, and type checking
jobs:
check:
strategy:
matrix:
runner:
- ubuntu-latest
version:
- "1.x"
runs-on: ${{ matrix.runner }}
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: "${{ matrix.version }}"
- name: Lint check
run: deno lint
- name: Format check
run: deno fmt --check
- name: Type check
run: deno task check
+ # Define jobs for testing across different operating systems and Vim/Neovim versions
test:
strategy:
matrix:
runner:
- windows-latest
- macos-latest
- ubuntu-latest
version:
- "1.32.x"
- "1.x"
host_version:
- vim: "v9.0.1499"
nvim: "v0.8.0"
runs-on: ${{ matrix.runner }}
steps:
- run: git config --global core.autocrlf false
if: runner.os == 'Windows'
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: thinca/vim-themis
path: vim-themis
- uses: denoland/setup-deno@v1
with:
deno-version: "${{ matrix.version }}"
- uses: rhysd/action-setup-vim@v1
id: vim
with:
version: "${{ matrix.host_version.vim }}"
- name: Check Vim
run: |
echo ${DENOPS_TEST_VIM}
${DENOPS_TEST_VIM} --version
env:
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }}
- uses: rhysd/action-setup-vim@v1
id: nvim
with:
neovim: true
version: "${{ matrix.host_version.nvim }}"
- name: Check Neovim
run: |
echo ${DENOPS_TEST_NVIM}
${DENOPS_TEST_NVIM} --version
env:
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }}
- name: Test (Vim)
env:
CI: 1
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
# XXX:
# Overwrite %TMP% to point a correct temp directory.
# Note that %TMP% only affects value of 'tempname()' in Windows.
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427
TMP: 'C:\Users\runneradmin\AppData\Local\Temp'
run: |
./vim-themis/bin/themis
timeout-minutes: 5
- name: Test (Neovim)
env:
CI: 1
THEMIS_VIM: ${{ steps.nvim.outputs.executable }}
# XXX:
# Overwrite %TMP% to point a correct temp directory.
# Note that %TMP% only affects value of 'tempname()' in Windows.
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427
TMP: 'C:\Users\runneradmin\AppData\Local\Temp'
run: |
./vim-themis/bin/themis
timeout-minutes: 5
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
name: test_vim | |
on: | |
schedule: | |
- cron: "0 7 * * 0" | |
push: | |
paths: | |
- "**.md" | |
- "**.ts" | |
- "**.vim" | |
- ".github/workflows/test.yml" | |
- "deno.jsonc" | |
pull_request: | |
paths: | |
- "**.md" | |
- "**.ts" | |
- "**.vim" | |
- ".github/workflows/test.yml" | |
- "deno.jsonc" | |
defaults: | |
run: | |
shell: bash --noprofile --norc -eo pipefail {0} | |
jobs: | |
check: | |
strategy: | |
matrix: | |
runner: | |
- ubuntu-latest | |
version: | |
- "1.x" | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- run: git config --global core.autocrlf false | |
if: runner.os == 'Windows' | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: "${{ matrix.version }}" | |
- name: Lint check | |
run: deno lint | |
- name: Format check | |
run: deno fmt --check | |
- name: Type check | |
run: deno task check | |
test: | |
strategy: | |
matrix: | |
runner: | |
- windows-latest | |
- macos-latest | |
- ubuntu-latest | |
version: | |
- "1.32.x" | |
- "1.x" | |
host_version: | |
- vim: "v9.0.1499" | |
nvim: "v0.8.0" | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- run: git config --global core.autocrlf false | |
if: runner.os == 'Windows' | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: thinca/vim-themis | |
path: vim-themis | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: "${{ matrix.version }}" | |
- uses: rhysd/action-setup-vim@v1 | |
id: vim | |
with: | |
version: "${{ matrix.host_version.vim }}" | |
- name: Check Vim | |
run: | | |
echo ${DENOPS_TEST_VIM} | |
${DENOPS_TEST_VIM} --version | |
env: | |
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }} | |
- uses: rhysd/action-setup-vim@v1 | |
id: nvim | |
with: | |
neovim: true | |
version: "${{ matrix.host_version.nvim }}" | |
- name: Check Neovim | |
run: | | |
echo ${DENOPS_TEST_NVIM} | |
${DENOPS_TEST_NVIM} --version | |
env: | |
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }} | |
- name: Test (Vim) | |
env: | |
CI: 1 | |
THEMIS_VIM: ${{ steps.vim.outputs.executable }} | |
# XXX: | |
# Overwrite %TMP% to point a correct temp directory. | |
# Note that %TMP% only affects value of 'tempname()' in Windows. | |
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | |
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | |
run: | | |
./vim-themis/bin/themis | |
timeout-minutes: 5 | |
- name: Test (Neovim) | |
env: | |
CI: 1 | |
THEMIS_VIM: ${{ steps.nvim.outputs.executable }} | |
# XXX: | |
# Overwrite %TMP% to point a correct temp directory. | |
# Note that %TMP% only affects value of 'tempname()' in Windows. | |
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | |
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | |
run: | | |
./vim-themis/bin/themis | |
timeout-minutes: 5 | |
name: test_vim | |
# Define triggers for the workflow | |
on: | |
schedule: | |
- cron: "0 7 * * 0" | |
push: | |
paths: | |
- "**.md" | |
- "**.ts" | |
- "**.vim" | |
- ".github/workflows/test.yml" | |
- "deno.jsonc" | |
pull_request: | |
paths: | |
- "**.md" | |
- "**.ts" | |
- "**.vim" | |
- ".github/workflows/test.yml" | |
- "deno.jsonc" | |
# Define default settings for all jobs | |
defaults: | |
run: | |
shell: bash --noprofile --norc -eo pipefail {0} | |
# Define jobs for linting, formatting, and type checking | |
jobs: | |
check: | |
strategy: | |
matrix: | |
runner: | |
- ubuntu-latest | |
version: | |
- "1.x" | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- run: git config --global core.autocrlf false | |
if: runner.os == 'Windows' | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: "${{ matrix.version }}" | |
- name: Lint check | |
run: deno lint | |
- name: Format check | |
run: deno fmt --check | |
- name: Type check | |
run: deno task check | |
# Define jobs for testing across different operating systems and Vim/Neovim versions | |
test: | |
strategy: | |
matrix: | |
runner: | |
- windows-latest | |
- macos-latest | |
- ubuntu-latest | |
version: | |
- "1.32.x" | |
- "1.x" | |
host_version: | |
- vim: "v9.0.1499" | |
nvim: "v0.8.0" | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- run: git config --global core.autocrlf false | |
if: runner.os == 'Windows' | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: thinca/vim-themis | |
path: vim-themis | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: "${{ matrix.version }}" | |
- uses: rhysd/action-setup-vim@v1 | |
id: vim | |
with: | |
version: "${{ matrix.host_version.vim }}" | |
- name: Check Vim | |
run: | | |
echo ${DENOPS_TEST_VIM} | |
${DENOPS_TEST_VIM} --version | |
env: | |
DENOPS_TEST_VIM: ${{ steps.vim.outputs.executable }} | |
- uses: rhysd/action-setup-vim@v1 | |
id: nvim | |
with: | |
neovim: true | |
version: "${{ matrix.host_version.nvim }}" | |
- name: Check Neovim | |
run: | | |
echo ${DENOPS_TEST_NVIM} | |
${DENOPS_TEST_NVIM} --version | |
env: | |
DENOPS_TEST_NVIM: ${{ steps.nvim.outputs.executable }} | |
- name: Test (Vim) | |
env: | |
CI: 1 | |
THEMIS_VIM: ${{ steps.vim.outputs.executable }} | |
# XXX: | |
# Overwrite %TMP% to point a correct temp directory. | |
# Note that %TMP% only affects value of 'tempname()' in Windows. | |
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | |
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | |
run: | | |
./vim-themis/bin/themis | |
timeout-minutes: 5 | |
- name: Test (Neovim) | |
env: | |
CI: 1 | |
THEMIS_VIM: ${{ steps.nvim.outputs.executable }} | |
# XXX: | |
# Overwrite %TMP% to point a correct temp directory. | |
# Note that %TMP% only affects value of 'tempname()' in Windows. | |
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/m-p/30432#M427 | |
TMP: 'C:\Users\runneradmin\AppData\Local\Temp' | |
run: | | |
./vim-themis/bin/themis | |
timeout-minutes: 5 |
Too fragile.. |
#313
Summary by CodeRabbit
New Features
denops#plugin
module functionality.Tests
Chores