0.4.1 #173
This file contains 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: "Build and Test on Windows" | |
on: ["push", "pull_request"] | |
jobs: | |
RunTestsOnWindows: | |
name: "Windows (Latest) - LuaJIT" | |
runs-on: "windows-latest" | |
strategy: | |
matrix: | |
compiler: ["LLVM", "MinGW", "MSVC"] | |
steps: | |
- uses: "actions/checkout@v4" | |
- name: "Install Dependencies" | |
run: "choco install -y cmake ninja" | |
- name: "Build LuaJIT" | |
run: "powershell scripts/buildLuaJIT.ps1" | |
- name: "Install LuaRocks" | |
run: "powershell scripts/installLuaRocks.ps1; mkdir LuaRocks/tree" | |
- name: "Set up LLVM" | |
if: "${{ matrix.compiler == 'LLVM' }}" | |
uses: "egor-tensin/setup-clang@v1" | |
- name: "Set up MinGW" | |
if: "${{ matrix.compiler == 'MinGW' }}" | |
uses: "e-t-l/setup-mingw@patch-1" | |
with: | |
platform: "x64" | |
- name: "Set up MSVC" | |
if: "${{ matrix.compiler == 'MSVC' }}" | |
uses: "compnerd/gha-setup-vsdevenv@main" | |
- name: "Configure Project" | |
run: | | |
New-Item -Path "LuaRocks\tree\luaRocksConfig.lua" -ItemType File | |
$env:LUAROCKS_TREE=$(Resolve-Path LuaRocks\tree) | |
$env:LUAROCKS_LUADIR=$(Resolve-Path LuaJIT\) | |
$env:LUAROCKS_CONFIG="$(Resolve-Path LuaRocks\tree\luaRocksConfig.lua)" | |
if (("${{ matrix.compiler }}" -eq "MinGW")) { | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config variables.LINK_FLAGS "$(Resolve-Path LuaJIT\bin\lua51.dll)" | |
} | |
if (("${{ matrix.compiler }}" -eq "MSVC")) { | |
Copy-Item "$(Resolve-Path libs\lua51.lib)" -Destination "$(Resolve-Path LuaJIT\bin)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config "variables.LUA_LIBDIR" "$(Resolve-Path LuaJIT\bin\)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config cmake_generator "Visual Studio 17 2022" | |
} else { | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config "variables.LUA_LIBDIR" "$(Resolve-Path LuaJIT\bin)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config cmake_generator "Ninja Multi-Config" | |
} | |
- name: "Build Project" | |
run: | | |
$env:LUAROCKS_TREE=$(Resolve-Path LuaRocks\tree) | |
$env:LUAROCKS_LUADIR=$(Resolve-Path LuaJIT\) | |
$env:LUAROCKS_CONFIG="$(Resolve-Path LuaRocks\tree\luaRocksConfig.lua)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" make | |
- name: "Run Tests" | |
run: | | |
mkdir LuaRocks\tree\share\lua\5.1\ | |
$env:LUAROCKS_TREE=$(Resolve-Path LuaRocks\tree) | |
$env:LUAROCKS_LUADIR=$(Resolve-Path LuaJIT\) | |
$env:LUAROCKS_CONFIG="$(Resolve-Path LuaRocks\tree\luaRocksConfig.lua)" | |
$env:LUA_CPATH="$(Resolve-Path LuaRocks\tree\lib\lua\5.1\)?.dll" | |
$env:LUA_PATH="$(Resolve-Path LuaRocks\tree\share\lua\5.1\)?.lua;$($pwd.Path)\?.lua" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" install luaunit | |
if (("${{ matrix.compiler }}" -ne "MSVC")) { | |
LuaJIT\bin\luajit.exe tests\tests.lua | |
} |