feat: add dummy test for linux
This commit is contained in:
parent
6595a51154
commit
937fa5f529
2 changed files with 67 additions and 0 deletions
9
.github/workflows/github-actions.yml
vendored
9
.github/workflows/github-actions.yml
vendored
|
@ -20,3 +20,12 @@ jobs:
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
- name: lint files against shfmt
|
- name: lint files against shfmt
|
||||||
run: make lint_shfmt
|
run: make lint_shfmt
|
||||||
|
test-setup-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: install soft
|
||||||
|
run: sudo apt install -y tmux git
|
||||||
|
- name: checkout repo
|
||||||
|
uses: actions/checkout@main
|
||||||
|
- name: test setup
|
||||||
|
run: ./tests/linux_setup_plugin_and_run.sh
|
||||||
|
|
58
tests/linux_setup_plugin_and_run.sh
Executable file
58
tests/linux_setup_plugin_and_run.sh
Executable file
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this test is meant to run on linux
|
||||||
|
#
|
||||||
|
# test target is:
|
||||||
|
# - ubuntu 20.04 LTS
|
||||||
|
# - bash
|
||||||
|
|
||||||
|
# default value of status-left section from gruvbox theme
|
||||||
|
readonly STATUS_LEFT_DEFAULT="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ "$(uname)" != "Linux" ]]; then
|
||||||
|
echo "NOT LINUX. Failed & exit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo apt update -y
|
||||||
|
sudo apt install -y tmux git
|
||||||
|
|
||||||
|
mkdir -p ~/.tmux/plugins/
|
||||||
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
|
|
||||||
|
cat <<EOF >~/.tmux.conf
|
||||||
|
# List of plugins
|
||||||
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||||
|
|
||||||
|
# Other plugins
|
||||||
|
set -g @plugin 'egel/tmux-gruvbox'
|
||||||
|
set -g @tmux-gruvbox 'dark'
|
||||||
|
|
||||||
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||||
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat ~/.tmux.conf
|
||||||
|
|
||||||
|
# manually install plugins
|
||||||
|
bash -c "${HOME}/.tmux/plugins/tpm/scripts/install_plugins.sh install_plugins"
|
||||||
|
|
||||||
|
# start new detached session
|
||||||
|
tmux new -d
|
||||||
|
|
||||||
|
# get status of something from theme
|
||||||
|
_status_left_current=$(tmux show-option -gqv status-left)
|
||||||
|
if [[ "$STATUS_LEFT_DEFAULT" != "$_status_left_current" ]]; then
|
||||||
|
echo "$STATUS_LEFT_DEFAULT"
|
||||||
|
echo "$_status_left_current"
|
||||||
|
echo "FAILED"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "SUCCESS"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
Loading…
Add table
Add a link
Reference in a new issue