Workflow file for this run
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: "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)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config variables.LUA_LIBDIR "$(Resolve-Path LuaJIT\bin)" | |
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")) { | |
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 "variables.LUALIB" "lua51.dll" | |
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 cmake_generator "Ninja Multi-Config" | |
} | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config | |
- name: "Set up MSVC" | |
if: "${{ matrix.compiler == 'MSVC' }}" | |
uses: "TheMrMilchmann/setup-msvc-dev@v3" | |
with: | |
arch: x64 | |
- 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)" config "variables.LUA_LIBDIR" "$(Resolve-Path LuaJIT)bin" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config "variables.LUALIB" "lua51.dll" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" | |
LuaRocks\luarocks.exe --lua-dir "$($env:LUAROCKS_LUADIR)" --tree "$($env:LUAROCKS_TREE)" config | |
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 | |
LuaJIT\bin\luajit.exe tests\tests.lua |