From 9b1c2a1d56d6a4189475ccc04f906e6060a51aa3 Mon Sep 17 00:00:00 2001 From: Sebastian Parschauer Date: Mon, 8 Jun 2026 12:44:16 +0200 Subject: [PATCH] fix(ci): Only update Luarocks if needed Updating all Luarocks versions might change behavior too much for latest OpenResty versions. So only do it for 1.19.* and 1.21.* where it is really required. Do so by just adding a case block around the Luarocks update. Print a message if it is not required. --- .github/workflows/test.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd7dceb..0bf72ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,18 +55,25 @@ jobs: - name: Install latest LuaRocks run: | - # Remove old luarocks if exists - rm -rf /usr/local/openresty/luajit/bin/luarocks* || true - # Download and install latest LuaRocks - cd /tmp - wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz - tar zxpf luarocks-3.12.2.tar.gz - cd luarocks-3.12.2 - ./configure --prefix=/usr/local/openresty/luajit \ - --with-lua=/usr/local/openresty/luajit \ - --lua-suffix=jit \ - --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 - make build && make install + case ${{ matrix.openresty_version }} in + 1.19.* | 1.21.*) + # Remove old luarocks if exists + rm -rf /usr/local/openresty/luajit/bin/luarocks* || true + # Download and install latest LuaRocks + cd /tmp + wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz + tar zxpf luarocks-3.12.2.tar.gz + cd luarocks-3.12.2 + ./configure --prefix=/usr/local/openresty/luajit \ + --with-lua=/usr/local/openresty/luajit \ + --lua-suffix=jit \ + --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 + make build && make install + ;; + *) + echo "No Luarocks update required" + ;; + esac - name: Install Luacov run: |