[CI] Fix tests (#624)

This commit is contained in:
Denis Isidoro 2021-09-16 09:11:35 -03:00 committed by GitHub
parent ec35cd0edc
commit 6674ca9410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View file

@ -49,12 +49,26 @@ jobs:
with:
command: test
- name: Install deps
run: |
_install() {
if command -v "$1"; then
return 0;
fi
sudo apt-get install "$1" || sudo apt install "$1" || brew install "$1"
};
_install_many() {
for dep in $@; do
_install "$dep"
done
}
_install_many git bash npm tmux
- name: Install fzf
run: git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf; yes | ~/.fzf/install;
- name: Install tmux
run: sudo apt-get install tmux || sudo apt install tmux || brew install tmux
- name: Install tealdeer
run: sudo npm install -g tldr

View file

@ -62,8 +62,11 @@ _navi_cheatsh() {
}
_navi_widget() {
echo "$(_navi widget "$1")" \
| grep -q "#!/usr/bin/env $1"
local -r out="$(_navi widget "$1")"
if ! echo "$out" | grep -q "navi "; then
echo "$out"
return 1
fi
}
_navi_cheatspath() {
@ -151,17 +154,17 @@ done
test::set_suite "info"
test::run "cheats_path" _navi_cheatspath
test::set_suite "integration"
test::run "welcome->pwd" _integration
test::set_suite "widget"
test::run "bash" _navi_widget "bash"
test::run "zsh" _navi_widget "zsh"
test::run "zsh" _navi_widget "fish"
test::run "fish" _navi_widget "fish"
test::run "elvish" _navi_widget "elvish"
test::set_suite "3rd party"
test::run "tldr" _navi_tldr
test::run "cheatsh" _navi_cheatsh
test::set_suite "integration"
test::run "welcome->pwd" _integration
test::finish