Skip to content

Commit 9dd1b68

Browse files
authored
Merge pull request #187 from preservim/test
Add CI workflow to actually test-drive Vimux This is fairly primitive, but it's a start. At least we will know if a PR makes some egregious error that makes basic functionality die. In the future we should probably write some small test scripts and verify the contents of panes with some sort of content capture for true unit regression testing, but a pass/fail grade that we don't explode is better than no testing.
2 parents 1b38911 + f02fa9c commit 9dd1b68

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-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)"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Vimux: easily interact with tmux from vim
22

33
[![Vint](https://github.com/preservim/vimux/workflows/Vint/badge.svg)](https://github.com/preservim/vimux/actions?workflow=Vint)
4+
[![Check](https://github.com/preservim/vimux/workflows/Check/badge.svg)](https://github.com/preservim/vimux/actions?workflow=Check)
45

56
![vimux](https://www.braintreepayments.com/blog/content/images/blog/vimux3.png)
67

0 commit comments

Comments
 (0)