Skip to content

docs: describe some of the features in README.md #59

docs: describe some of the features in README.md

docs: describe some of the features in README.md #59

Workflow file for this run

name: CI
env:
_NVIM_REPO: neovim/neovim
_PLENARY_REPO: nvim-lua/plenary.nvim
_ARCHIVE_URL: https://github.com/${repo:?}/archive/refs/tags/${tag:?}.tar.gz
PLENARY: ~/plenary
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
# - name: Setup Vim
# You may pin to the exact commit or the version.
# uses: rhysd/action-setup-vim@015df8c5b8dabdca7febe31bb66c156c0d780374
# uses: rhysd/action-setup-vim@v1.2.15
# with:
# version: stable
# neovim: true
test:
runs-on: ubuntu-latest
steps:
- run: printf %s=%s\\n HOME ~ >> "${GITHUB_ENV:?}"
- name: Get latest dependency versions
env:
GH_TOKEN: ${{ github.token }}
run: |
_LATEST_NVIM_RELEASE_ID="$(gh release view stable -R "${_NVIM_REPO:?}" --json id -q .id)"
_LATEST_PLENARY_TAG="$(
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/${_PLENARY_REPO:?}/tags" \
-q '.[].name' \
| grep -E '^[Vv][[:digit:].]+$' \
| sort -V \
| tail -n 1
)"
echo "_LATEST_PLENARY_TAG=${_LATEST_PLENARY_TAG:?}" >> "${GITHUB_ENV:?}"
echo "_LATEST_NVIM_RELEASE_ID=${_LATEST_NVIM_RELEASE_ID:?}" >> "${GITHUB_ENV:?}"
- name: Restore cache
id: restore-cache
uses: actions/cache/restore@v3
with:
path: |
${{ env.HOME }}/nvim
${{ env.HOME }}/plenary
key: ${{ runner.os }}-deps-nvim@${{ env._LATEST_NVIM_RELEASE_ID }}-plenary@${{ env._LATEST_PLENARY_TAG }}
- if: ${{ !steps.restore-cache.outputs.cache-hit }}
name: Download nvim
working-directory: ${{ env.HOME }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download stable -R "${_NVIM_REPO:?}" -p nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage --appimage-extract
rm nvim.appimage
mv squashfs-root nvim
- if: ${{ !steps.restore-cache.outputs.cache-hit }}
name: Download plenary
working-directory: ${{ env.HOME }}
env:
GITHUB_TOKEN:
GH_TOKEN:
run: |
repo="${_PLENARY_REPO:?}"
tag="${_LATEST_PLENARY_TAG:?}"
url="$(cat <<EOF
${{ env._ARCHIVE_URL }}
EOF
)"
curl -L "${url:?}" | tar xzf -
mv *plenary* plenary
- if: ${{ !steps.restore-cache.outputs.cache-hit }}
name: Cache deps
uses: actions/cache/save@v3
with:
path: |
${{ env.HOME }}/nvim
${{ env.HOME }}/plenary
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- uses: actions/checkout@v3
- name: Add nvim to PATH
run: echo ~/nvim/usr/bin >> "${GITHUB_PATH:?}"
- name: Test
run: make test