Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
$HOME/.local/bin/mise exec -- luarocks list | grep luacheck
22 changes: 16 additions & 6 deletions lib/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading