diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd4a94d..6251041 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/tests/run b/tests/run index 269eddd..25cf33b 100755 --- a/tests/run +++ b/tests/run @@ -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