Skip to content

Commit d644355

Browse files
authored
CI: cache luarocks folder (#1057)
* ci: cache luarocks folder * ci: make cache only save if it's not present As per actions/toolkit#658 (comment), overwriting a saved cache doesn't work and throws a warning.
1 parent 4d0e4f1 commit d644355

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828

2929
- uses: luarocks/gh-actions-luarocks@master
3030

31+
- name: Restore cached LuaRocks packages
32+
id: cache
33+
uses: actions/cache/restore@v4
34+
with:
35+
path: ${{ runner.os == 'Windows' && 'C:\\Users\\runneradmin\\AppData\\Roaming\\luarocks' || format('{0}/.luarocks', github.workspace) }}
36+
key: ${{ runner.os }}-luarocks-${{ matrix.lua-version }}-${{ hashFiles('**/luarocks.lock') }}
37+
3138
- name: Build
3239
run: |
3340
luarocks make --only-deps
@@ -37,3 +44,10 @@ jobs:
3744
luarocks lint tl-dev-1.rockspec
3845
make selfbuild
3946
luarocks test
47+
48+
- name: Save LuaRocks packages
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
uses: actions/cache/save@v4
51+
with:
52+
path: ${{ runner.os == 'Windows' && 'C:\\Users\\runneradmin\\AppData\\Roaming\\luarocks' || format('{0}/.luarocks', github.workspace) }}
53+
key: ${{ runner.os }}-luarocks-${{ matrix.lua-version }}-${{ hashFiles('**/luarocks.lock') }}

0 commit comments

Comments
 (0)