Skip to content

Commit 14f94ab

Browse files
committed
feat: implement Folke's cached Neovim installation approach
- Add date-based caching for Neovim installation - Use AppImage with proper extraction (more reliable) - Cache Neovim by date and version to speed up CI runs - Remove unnecessary Lua/LuaRocks installation - Store Neovim in runner.temp directory for better isolation This significantly speeds up workflow runs by caching Neovim and only downloading when the cache expires or version changes.
1 parent 7ddd04f commit 14f94ab

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,41 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20+
- name: Setup date
21+
shell: bash
22+
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
23+
24+
- name: Restore Neovim cache
25+
id: cache-neovim-restore
26+
uses: actions/cache/restore@v4
27+
with:
28+
path: ${{ runner.temp }}/nvim
29+
key: neovim-cache-${{ env.DATE }}-stable
30+
2031
- name: Install Neovim
32+
if: steps.cache-neovim-restore.outputs.cache-hit != 'true'
2133
shell: bash
2234
run: |
23-
mkdir -p ~/nvim
24-
wget https://github.com/neovim/neovim/releases/download/v0.10.0/nvim-linux64.tar.gz -O nvim-linux64.tar.gz
25-
tar -C ~/nvim -xzf nvim-linux64.tar.gz --strip-components=1
26-
echo "$HOME/nvim/bin" >> $GITHUB_PATH
27-
28-
- name: Neovim version
29-
run: nvim --version
35+
mkdir -p ${{ runner.temp }}/nvim
36+
wget -q https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.appimage -O ${{ runner.temp }}/nvim/nvim.appimage
37+
cd ${{ runner.temp }}/nvim
38+
chmod a+x ./nvim.appimage
39+
./nvim.appimage --appimage-extract
3040
31-
- name: Install system dependencies
32-
run: |
33-
sudo apt-get update
34-
sudo apt-get install -y lua5.1 liblua5.1-dev luarocks
41+
- name: Save Neovim cache
42+
if: steps.cache-neovim-restore.outputs.cache-hit != 'true'
43+
uses: actions/cache/save@v4
44+
with:
45+
path: ${{ runner.temp }}/nvim
46+
key: neovim-cache-${{ env.DATE }}-stable
3547

36-
- name: Install Lua dependencies
48+
- name: Add Neovim to PATH
49+
shell: bash
3750
run: |
38-
sudo luarocks install luassert
39-
sudo luarocks install busted
51+
echo "${{ runner.temp }}/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
52+
53+
- name: Neovim version
54+
run: nvim --version
4055

4156
- name: Test Cache
4257
uses: actions/cache@v4

0 commit comments

Comments
 (0)