diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index 60121f2..26aa7c9 100644 --- a/.github/workflows/e2e_test.yaml +++ b/.github/workflows/e2e_test.yaml @@ -87,6 +87,15 @@ jobs: echo "Lua version $LUA_VERSION installed successfully" fi + - name: install latest lua by vfox-lua plugin (Linux) + if: runner.os == 'Linux' && matrix.lua_version == '5.5.0' + run: | + vfox install lua@latest + eval "$(vfox activate bash)" + vfox use -g lua@latest + eval "$(vfox activate bash)" + lua -v | grep '^Lua [0-9]' + - name: verify liblua.a is compiled with -fPIC (Linux) if: runner.os == 'Linux' env: @@ -259,4 +268,4 @@ jobs: echo "=== Verify LuaRocks ===" $HOME/.local/bin/mise exec -- luarocks --version $HOME/.local/bin/mise exec -- luarocks install luacheck - $HOME/.local/bin/mise exec -- luarocks list | grep luacheck \ No newline at end of file + $HOME/.local/bin/mise exec -- luarocks list | grep luacheck diff --git a/lib/utils.lua b/lib/utils.lua index d68022c..56f7e88 100644 --- a/lib/utils.lua +++ b/lib/utils.lua @@ -2,17 +2,27 @@ local http = require("http") local lua_utils = {} +local function parse_version_line(line) + return string.match(line, "([^,]+),([^,]+)") +end + +local function is_lua_release_version(version) + return string.match(version, "^%d") ~= nil +end + function lua_utils.get_lua_release_verions() local result = {} local resp, err = http.get({ url = "https://fastly.jsdelivr.net/gh/yeshan333/vfox-lua@main/assets/versions.txt" }) for line in string.gmatch(resp.body, '([^\n]+)') do - local version, checksum = string.match(line, "([^,]+),([^,]+)") - table.insert(result, { - version = version, - checksum = checksum - }) + local version, checksum = parse_version_line(line) + if version and checksum and is_lua_release_version(version) then + table.insert(result, { + version = version, + checksum = checksum + }) + end end return result @@ -23,7 +33,7 @@ function lua_utils.get_version_info(lua_version) url = "https://fastly.jsdelivr.net/gh/yeshan333/vfox-lua@main/assets/versions.txt" }) for line in string.gmatch(resp.body, '([^\n]+)') do - local version, checksum = string.match(line, "([^,]+),([^,]+)") + local version, checksum = parse_version_line(line) if lua_version == version then return version, checksum end