Skip to content

Fix Lua 5.5.0 install failure on Linux (#8) #45

Fix Lua 5.5.0 install failure on Linux (#8)

Fix Lua 5.5.0 install failure on Linux (#8) #45

Workflow file for this run

name: E2E tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
e2e_tests:
strategy:
matrix:
# ref: https://github.com/actions/runner-images
os: [ubuntu-latest, macos-latest, windows-latest]
lua_version: [5.5.0, 5.4.7, 5.3.6]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.24.2' # The Go version to download (if necessary) and use.
- name: build & install vfox (Unix-like)
if: runner.os != 'Windows'
run: |
git clone https://github.com/version-fox/vfox.git
cd vfox
go build -o vfox
chmod +x vfox
cp vfox /usr/local/bin
- name: build & install vfox (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/version-fox/vfox.git
cd vfox
go build -o vfox.exe
echo "$pwd" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
./vfox.exe -version
- name: install readline lib (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install libreadline-dev -y
- name: install readline lib (MacOS)
if: runner.os == 'MacOS'
run: |
brew install readline
- name: add vfox-lua plugin
if: runner.os == 'Windows'
run: |
vfox add --source https://github.com/${{ github.repository_owner }}/vfox-lua/archive/$env:GITHUB_REF.zip lua
- name: add vfox-lua plugin
if: runner.os != 'Windows'
run: |
vfox add --source https://github.com/${{ github.repository_owner }}/vfox-lua/archive/${GITHUB_REF}.zip lua
- name: install lua by vfox-lua plugin (Linux)
if: runner.os == 'Linux'
env:
LUA_VERSION: ${{ matrix.lua_version }}
run: |
vfox install lua@$LUA_VERSION
eval "$(vfox activate bash)"
vfox use -g lua@$LUA_VERSION
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
status=$(lua -v | grep $LUA_VERSION)
if [ -z "$status" ]; then
echo "Lua version is not $LUA_VERSION"
exit 1
else
echo "Lua version $LUA_VERSION installed successfully"
fi
- name: install lua by vfox-lua plugin (Darwin)
if: runner.os == 'MacOS'
env:
LUA_VERSION: ${{ matrix.lua_version }}
run: |
vfox install lua@$LUA_VERSION
eval "$(vfox activate bash)"
vfox use -g lua@$LUA_VERSION
eval "$(vfox activate bash)"
echo "===============PATH==============="
echo $PATH
echo "===============PATH==============="
status=$(lua -v | grep $LUA_VERSION)
if [ -z "$status" ]; then
echo "Lua version is not @$LUA_VERSION"
exit 1
else
echo "Lua version $LUA_VERSION installed successfully"
fi
- name: Setup MSYS2 (Windows)
uses: msys2/setup-msys2@v2
if: runner.os == 'Windows'
with:
msystem: MINGW64
update: true
install: >
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
- name: Verify GCC and Make installation (Windows)
shell: pwsh
if: runner.os == 'Windows'
run: |
gcc --version
make --version
- name: install Lua by vfox-lua plugin (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
LUA_VERSION: "${{ matrix.lua_version }}"
run: |
vfox install "lua@$env:LUA_VERSION"
Invoke-Expression "$(vfox activate pwsh)"
vfox use -g "lua@$env:LUA_VERSION"
Invoke-Expression "$(vfox activate pwsh)"
echo "===============PATH==============="
echo $env:PATH
echo "===============PATH==============="
$result=(lua.exe -v)
if ($result -match "Lua $env:LUA_VERSION") {
Write-Output "lua@$env:LUA_VERSION installed successfully!"
} else {
Write-Output "lua@$env:LUA_VERSION installed failed!"
exit 1
}