-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 3.68 KB
/
buildAndTest-Windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
}