tests #1588
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
inputs: | |
enable_debug_vnc: | |
required: false | |
type: boolean | |
default: false | |
enable_debug_tmate: | |
required: false | |
type: boolean | |
default: false | |
debug_kitty_version: | |
required: false | |
type: string | |
default: 'stable' | |
debug_nvim_version: | |
required: false | |
type: string | |
default: 'stable' | |
schedule: | |
# 6am EST | |
- cron: "0 10 * * *" | |
jobs: | |
plenary: | |
strategy: | |
matrix: | |
nvim_version: | |
- 'stable' # v0.10.0 | |
- 'nightly' | |
kitty_version: | |
- 'stable' # 0.37.+ | |
- 'nightly' | |
# update __branch-protection-rules.json and run __update_branch_protection_rules.sh when modified | |
# test all version of nvim released as of v0.9.0 | |
# test only latest patch versions of kitty released as of v0.32.2 | |
include: | |
# nvim versions + kitty stable | |
- nvim_version: 'v0.9.0' | |
kitty_version: 'stable' | |
- nvim_version: 'v0.9.5' | |
kitty_version: 'stable' | |
# nvim stable + kitty versions | |
- nvim_version: 'stable' | |
kitty_version: '0.32.2' | |
- nvim_version: 'stable' | |
kitty_version: '0.33.1' | |
- nvim_version: 'stable' | |
kitty_version: '0.34.1' | |
- nvim_version: 'stable' | |
kitty_version: '0.35.2' | |
- nvim_version: 'stable' | |
kitty_version: '0.36.4' | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version) }} | |
uses: actions/checkout@v3 | |
- name: Setup Neovim ${{ matrix.nvim_version }} | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version) }} | |
uses: rhysd/action-setup-vim@v1 | |
with: | |
neovim: true | |
version: ${{ matrix.nvim_version }} | |
- name: Setup Kitty ${{ matrix.kitty_version }} | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version) }} | |
run: | | |
"$GITHUB_WORKSPACE/scripts/internal/__kitty_installer.sh" launch=n version=${{ matrix.kitty_version }} | |
- name: Install dependencies | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version) }} | |
run: | | |
sudo apt update | |
sudo apt install -y xfce4 libxcb-xkb1 xsel tmux fish | |
# homebrew is not used but is required to reproduce an issue for a test case | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
- name: Start Xvfb | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (!inputs.enable_debug_vnc && (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version)) }} | |
run: | | |
Xvfb :1 -screen 0 1024x768x16 & | |
- name: (debug) Start TurboVNC | |
if: ${{ inputs.enable_debug_vnc && (inputs.debug_kitty_version == matrix.kitty_version) && (inputs.debug_nvim_version == matrix.nvim_version) }} | |
run: | | |
mkdir -p "$GITHUB_WORKSPACE/tmp" | |
curl -s -L https://github.com/TurboVNC/turbovnc/releases/download/3.1/turbovnc_3.1_amd64.deb -o "$GITHUB_WORKSPACE/tmp/turbovnc.deb" | |
cd "$GITHUB_WORKSPACE/tmp" || exit 1 | |
sudo dpkg -i turbovnc.deb | |
sudo apt update | |
sudo apt install -f | |
cd "$GITHUB_WORKSPACE" || exit 1 | |
export PATH="/opt/TurboVNC/bin:$PATH" | |
vncserver -geometry 2560x1080 -SecurityTypes None | |
echo 'export PATH="/opt/TurboVNC/bin:$PATH"' >> "$HOME/.bashrc" | |
- name: (debug) Setup ngrok session | |
if: ${{ inputs.enable_debug_vnc && (inputs.debug_kitty_version == matrix.kitty_version) && (inputs.debug_nvim_version == matrix.nvim_version) }} | |
env: | |
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} | |
run: | | |
mkdir -p "$GITHUB_WORKSPACE/tmp/bin" | |
curl -s -L https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz -o "$GITHUB_WORKSPACE/tmp/ngrok.tgz" | |
cd "$GITHUB_WORKSPACE/tmp" || exit 1 | |
tar -xvf ngrok.tgz -C "$GITHUB_WORKSPACE/tmp/bin" | |
cd "$GITHUB_WORKSPACE" || exit 1 | |
export PATH="$GITHUB_WORKSPACE/tmp/bin:$PATH" | |
ngrok config add-authtoken "$NGROK_AUTH_TOKEN" | |
ngrok tcp 22 --log=stdout > "$GITHUB_WORKSPACE/tmp/ngrok.log" & | |
sleep 1 # wait for ngrok to start | |
NGROK_TLS_URL="$(curl --silent http://127.0.0.1:4040/api/tunnels | jq -r '.tunnels[0].public_url')" | |
host="$(echo $NGROK_TLS_URL | awk -F:// '{print $2}' | awk -F: ' {print $1}')" | |
port="$(echo $NGROK_TLS_URL | awk -F:// '{print $2}' | awk -F: ' {print $2}')" | |
printf '\n\nngrok agent running avaible at %s\n\nRun the following command on your machine:\n\n ssh -L 59000:localhost:5901 -C -N -p %s -l runner %s\n\nConnect on your machine at: localhost:59000\n\n' $NGROK_TLS_URL $port $host | |
- name: (debug) Add env vars to .bashrc | |
if: ${{ (inputs.enable_debug_tmate || inputs.enable_debug_vnc) && (inputs.debug_kitty_version == matrix.kitty_version) && (inputs.debug_nvim_version == matrix.nvim_version) }} | |
run: | | |
echo 'export KITTY_CONFIG_DIRECTORY="$GITHUB_WORKSPACE/tests"' >> "$HOME/.bashrc" | |
echo 'export PATH=$HOME/.local/kitty.app/bin:/home/linuxbrew/.linuxbrew/bin:$PATH' >> "$HOME/.bashrc" | |
echo 'export DISPLAY=:1' >> "$HOME/.bashrc" | |
echo 'export PS1="\[\e[34m\]$ \[\e[m\]"' >> "$HOME/.bashrc" | |
- name: (debug) Setup tmate session | |
if: ${{ (inputs.enable_debug_tmate || inputs.enable_debug_vnc) && (inputs.debug_kitty_version == matrix.kitty_version) && (inputs.debug_nvim_version == matrix.nvim_version) }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Test kitty-scrollback.nvim | |
if: ${{ !(inputs.enable_debug_tmate || inputs.enable_debug_vnc) || (inputs.debug_kitty_version == matrix.kitty_version && inputs.debug_nvim_version == matrix.nvim_version) }} | |
run: | | |
# TODO: improve the env var exports, github actions are making it hard so I gave up for now | |
export KITTY_CONFIG_DIRECTORY="$GITHUB_WORKSPACE/tests" | |
export PATH=$HOME/.local/kitty.app/bin:/home/linuxbrew/.linuxbrew/bin:$PATH | |
export DISPLAY=:1 | |
export PS1="\[\e[34m\]$ \[\e[m\]" | |
echo 'export KITTY_CONFIG_DIRECTORY="$GITHUB_WORKSPACE/tests"' >> "$HOME/.bashrc" | |
echo 'export PATH=$HOME/.local/kitty.app/bin:/home/linuxbrew/.linuxbrew/bin:$PATH' >> "$HOME/.bashrc" | |
echo 'export DISPLAY=:1' >> "$HOME/.bashrc" | |
echo 'export PS1="\[\e[34m\]$ \[\e[m\]"' >> "$HOME/.bashrc" | |
make test-all-sequential | |