Skip to content

Commit f673dd9

Browse files
authored
fix(ci): Only update Luarocks if needed (#343)
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.
1 parent 2cf1947 commit f673dd9

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/test.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,25 @@ jobs:
5555

5656
- name: Install latest LuaRocks
5757
run: |
58-
# Remove old luarocks if exists
59-
rm -rf /usr/local/openresty/luajit/bin/luarocks* || true
60-
# Download and install latest LuaRocks
61-
cd /tmp
62-
wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz
63-
tar zxpf luarocks-3.12.2.tar.gz
64-
cd luarocks-3.12.2
65-
./configure --prefix=/usr/local/openresty/luajit \
66-
--with-lua=/usr/local/openresty/luajit \
67-
--lua-suffix=jit \
68-
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
69-
make build && make install
58+
case ${{ matrix.openresty_version }} in
59+
1.19.* | 1.21.*)
60+
# Remove old luarocks if exists
61+
rm -rf /usr/local/openresty/luajit/bin/luarocks* || true
62+
# Download and install latest LuaRocks
63+
cd /tmp
64+
wget https://luarocks.org/releases/luarocks-3.12.2.tar.gz
65+
tar zxpf luarocks-3.12.2.tar.gz
66+
cd luarocks-3.12.2
67+
./configure --prefix=/usr/local/openresty/luajit \
68+
--with-lua=/usr/local/openresty/luajit \
69+
--lua-suffix=jit \
70+
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
71+
make build && make install
72+
;;
73+
*)
74+
echo "No Luarocks update required"
75+
;;
76+
esac
7077
7178
- name: Install Luacov
7279
run: |

0 commit comments

Comments
 (0)