Skip to content

Commit a6d93c4

Browse files
authored
Fix CI (#106)
* Fix CI - Fix macos download link - Fix g:ruby_host_prog not supporting spaces anymore - Fix flaky order-dependent client info spec - remove hardcoded ruby versions so i don't have to keep updating them
1 parent 4182796 commit a6d93c4

File tree

8 files changed

+36
-41
lines changed

8 files changed

+36
-41
lines changed

.github/workflows/tests.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, macos-latest]
15-
ruby: [2.7, 3.0, 3.1, 3.2, head]
15+
ruby: [ruby, head]
1616
runs-on: ${{ matrix.os }}
1717
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1818
steps:
@@ -37,8 +37,6 @@ jobs:
3737
windows:
3838
strategy:
3939
fail-fast: false
40-
matrix:
41-
ruby: [2.7, 3.0, 3.1, 3.2]
4240
runs-on: windows-latest
4341
if: "!contains(github.event.head_commit.message, '[skip ci]')"
4442
steps:
@@ -51,7 +49,7 @@ jobs:
5149
repository: neovim/neovim-ruby
5250
- uses: ruby/setup-ruby@v1
5351
with:
54-
ruby-version: ${{ matrix.ruby }}
52+
ruby-version: ruby
5553
bundler-cache: true
5654
- name: Install Neovim
5755
uses: crazy-max/ghaction-chocolatey@v1

Flavorfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
thinca/vim-themis (737e5444713ba53a9dcfbe3b962239bd0bd9162e at master)
1+
thinca/vim-themis (c1f4d465ce7dd23735513551b5c4c918d9c1bab1 at master)

script/ci/download_nvim.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ set -eu
77
case "$(echo "$RUNNER_OS" | tr "[:upper:]" "[:lower:]")" in
88
macos)
99
wget -nv -P /tmp \
10-
"https://github.com/neovim/neovim/releases/download/stable/nvim-macos.tar.gz"
11-
tar -C /tmp -xzf /tmp/nvim-macos.tar.gz
12-
mv /tmp/nvim-macos ./_nvim
10+
"https://github.com/neovim/neovim/releases/download/stable/nvim-macos-x86_64.tar.gz"
11+
tar -C /tmp -xzf /tmp/nvim-macos-x86_64.tar.gz
12+
mv /tmp/nvim-macos-x86_64 ./_nvim
1313
;;
1414
linux)
1515
mkdir -p _nvim/bin

script/host_wrapper.bat

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
pushd "%~dp0\.." 2>NUL
3+
ruby -I %CD%\lib %CD%\exe\neovim-ruby-host %*

script/host_wrapper.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "$0")/.."
4+
5+
exec ruby -I ./lib ./exe/neovim-ruby-host "$@"

script/run_acceptance.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"NVIM_RPLUGIN_MANIFEST" => manifest,
2222
"THEMIS_VIM" => nvim,
2323
"THEMIS_HOME" => themis_home,
24-
"THEMIS_ARGS" => "-e -s --headless -u #{vimrc}"
24+
"THEMIS_ARGS" => "-e --headless -u #{vimrc}"
2525
}
2626

2727
FileUtils.rm_f(manifest)
@@ -30,7 +30,7 @@
3030
system(
3131
env,
3232
nvim,
33-
"-e", "-s", "--headless",
33+
"-e", "--headless",
3434
"-u", vimrc,
3535
"+UpdateRemotePlugins", "+qa!"
3636
)

spec/acceptance/client_info_spec.vim

+14-30
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,18 @@ function! s:suite.before_each() abort
99
\ "v:val.client")
1010
endfunction
1111

12-
function! s:suite.get_script_host_client_info() abort
13-
let client_info = s:client_chans[1]
14-
15-
call s:expect(sort(keys(client_info))).to_equal(
16-
\ ["attributes", "methods", "name", "type", "version"])
17-
18-
call s:expect(client_info.attributes).to_be_dict()
19-
call s:expect(client_info.methods).to_equal({"specs": {"nargs": 1}, "poll": {}})
20-
call s:expect(client_info.name).to_equal("ruby-script-host")
21-
call s:expect(client_info.type).to_equal("host")
22-
23-
call s:expect(client_info.version.major).to_be_number()
24-
call s:expect(client_info.version.minor).to_be_number()
25-
call s:expect(client_info.version.patch).to_be_number()
26-
endfunction
27-
28-
function! s:suite.get_rplugin_client_info() abort
29-
let client_info = s:client_chans[0]
30-
31-
call s:expect(sort(keys(client_info))).to_equal(
32-
\ ["attributes", "methods", "name", "type", "version"])
33-
34-
call s:expect(client_info.attributes).to_be_dict()
35-
call s:expect(client_info.methods).to_equal({"specs": {"nargs": 1}, "poll": {}})
36-
call s:expect(client_info.name).to_equal("ruby-rplugin-host")
37-
call s:expect(client_info.type).to_equal("host")
38-
39-
call s:expect(client_info.version.major).to_be_number()
40-
call s:expect(client_info.version.minor).to_be_number()
41-
call s:expect(client_info.version.patch).to_be_number()
12+
function! s:suite.get_client_info() abort
13+
for client_info in s:client_chans
14+
call s:expect(sort(keys(client_info))).to_equal(
15+
\ ["attributes", "methods", "name", "type", "version"])
16+
17+
call s:expect(client_info.attributes).to_be_dict()
18+
call s:expect(client_info.methods).to_equal({"specs": {"nargs": 1}, "poll": {}})
19+
call s:expect(client_info.name).to_match("ruby-\\(script\\|rplugin\\)-host")
20+
call s:expect(client_info.type).to_equal("host")
21+
22+
call s:expect(client_info.version.major).to_be_number()
23+
call s:expect(client_info.version.minor).to_be_number()
24+
call s:expect(client_info.version.patch).to_be_number()
25+
endfor
4226
endfunction

spec/acceptance/runtime/init.vim

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
let s:lib_path = getcwd() . "/lib"
22
let s:exe_path = getcwd() . "/exe/neovim-ruby-host"
33
let g:acceptance_rtp = getcwd() . "/spec/acceptance/runtime"
4-
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:exe_path)
4+
5+
if has("win32") || has("win64")
6+
let g:ruby_host_prog = getcwd() . "/script/host_wrapper.bat"
7+
else
8+
let g:ruby_host_prog = getcwd() . "/script/host_wrapper.sh"
9+
endif
510

611
ruby require "rspec/expectations"
712
ruby include ::RSpec::Matchers.dup

0 commit comments

Comments
 (0)