Skip to content

Commit ccde41e

Browse files
committed
CI: inline tests script
1 parent baa6a33 commit ccde41e

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/msbuild.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,32 @@ jobs:
4242
- name: Test
4343
shell: pwsh
4444
run: |
45-
& tests\run.ps1
45+
$ErrorActionPreference = 'Stop'
46+
47+
Invoke-WebRequest https://www.nuget.org/api/v2/package/lua/5.4.6 -OutFile lua-5.4.6.zip
48+
Expand-Archive -Path .\lua-5.4.6.zip -DestinationPath lua
49+
Remove-Item -Path lua-5.4.6.zip
50+
Move-Item -Path .\lua\build\native\bin\Win32\v143\Release\* -Destination .
51+
Remove-Item -Recurse -Path lua\
52+
53+
Copy-Item -Path Release\*.dll -Destination .
54+
55+
Remove-Item .\tests\run.lua -ErrorAction SilentlyContinue
56+
57+
@"
58+
local lunatest = require('tests.lunatest.lunatest')
59+
local rps = require("RPS")
60+
61+
"@ | Add-Content -Path "tests\run.lua"
62+
Get-Item -Path "tests\test-*.lua" | Resolve-Path -Relative | ForEach-Object {$_.Substring(2)} | ForEach-Object {$_.Substring(0, $_.Length - 4)} | ForEach-Object {"lunatest.suite('$_')"} | ForEach-Object {$_.Replace('\', '.')} | Add-Content -Path "tests\run.lua"
63+
"lunatest.run()" | Add-Content -Path "tests\run.lua"
64+
65+
66+
& lua.exe tests\run.lua -v
67+
68+
Remove-Item *.dll
69+
Remove-Item *.exe
70+
Remove-Item .\tests\run.lua
4671
4772
- name: Create nuget package
4873
working-directory: ${{env.GITHUB_WORKSPACE}}

0 commit comments

Comments
 (0)