Skip to content

Commit

Permalink
[CI] Fix tests (denisidoro#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro authored Sep 16, 2021
1 parent ec35cd0 commit 6674ca9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 9 additions & 6 deletions tests/run
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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

0 comments on commit 6674ca9

Please sign in to comment.