test: more lua version #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-22.04, macos-13, windows-latest] | |
lua_version: [5.4.7, 5.3.6, 5.1.5] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install vfox (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
echo "deb [trusted=yes] https://apt.fury.io/versionfox/ /" | sudo tee /etc/apt/sources.list.d/versionfox.list | |
sudo apt-get update | |
sudo apt-get install vfox | |
- name: install vfox (MacOS) | |
if: runner.os == 'MacOS' | |
run: | | |
brew tap version-fox/tap | |
brew install vfox | |
- name: install scoop (Windows) | |
if: runner.os == 'Windows' | |
uses: MinoruSekine/setup-scoop@v3 | |
- name: install vfox (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
scoop install vfox | |
- 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 | |
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 | |
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: powershell | |
if: runner.os == 'Windows' | |
run: | | |
gcc --version | |
make --version | |
- name: install Lua by vfox-lua plugin (Windows) | |
if: runner.os == 'Windows' | |
env: | |
LUA_VERSION: "${{ matrix.lua_version }}" | |
run: | | |
vfox install "lua@$env:LUA_VERSION" | |
vfox use -g "lua@$env:LUA_VERSION" | |
Invoke-Expression "$(vfox activate pwsh)" | |
echo "===============PATH===============" | |
echo $env:PATH | |
echo "===============PATH===============" | |
Invoke-Expression "$(vfox activate pwsh)" | |
$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 | |
} |