Skip to content

Commit fb43fcb

Browse files
committed
Add CI workflow to actually test-drive Vimux
1 parent 1b38911 commit fb43fcb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/check.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check
2+
on: [push, pull_request]
3+
jobs:
4+
check:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
vimFlavor: ["vim", "nvim"]
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Enable Universe package repository
14+
run: |
15+
sudo add-apt-repository universe
16+
sudo apt-get update
17+
- name: Install tmux and ${{ matrix.tagsProvider }}
18+
run: |
19+
sudo apt-get install tmux ${{ matrix.vimFlavor == 'nvim' && 'neovim' || 'vim' }}
20+
- name: Review versions
21+
run: |
22+
tmux -V
23+
${{ matrix.vimFlavor }} --version
24+
# This tests looks for two thigs:
25+
# * That VIM doesn't hang. If it succedes it will quit quickly. If 5
26+
# seconds later the tmux session is still running either the runner pane
27+
# didn't get closed or (more likely) we threw some error and VIM is
28+
# sitting there expecting us to acknowledge the message(s).
29+
# * That VIM exited normally. This check isn't very useful since :qa
30+
# never bubbles up an error, but if someday we use :cq for a test being
31+
# ready to check the exit code seems like a good thing.
32+
- name: "Try Vimux"
33+
run: |
34+
ec="$(mktemp)"
35+
tmux new -s ci -d "${{ matrix.vimFlavor == 'nvim' && 'nvim -u /dev/null --headless' || 'vim' }} -i NONE \"+so plugin/vimux.vim\" \"+VimuxRunCommand('date')\" \"+VimuxCloseRunner | qa\"; echo \$? > '$ec'"
36+
sleep 5
37+
tmux kill-session -t ci && exit 1
38+
exit "$(cat $ec)"

0 commit comments

Comments
 (0)