Skip to content

Commit e4c5cb8

Browse files
committed
Add Windows CI for tool tests
The pr-tools.yml workflow only ran on Linux. Add a Windows job and the supporting make.ps1 test blocks so pony-doc, pony-lint, and pony-lsp tests also run on Windows. Closes #5043
1 parent 06a207c commit e4c5cb8

2 files changed

Lines changed: 114 additions & 0 deletions

File tree

.github/workflows/pr-tools.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,36 @@ jobs:
5252
run: make test-pony-lsp config=debug
5353
- name: Lint pony-lint
5454
run: make lint-pony-lint config=debug
55+
56+
x86_64-windows:
57+
if: github.event.pull_request.draft == false
58+
runs-on: windows-2025
59+
defaults:
60+
run:
61+
shell: pwsh
62+
63+
name: Tools (Windows)
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v6.0.2
67+
- name: Restore Libs Cache
68+
id: restore-libs
69+
uses: actions/cache/restore@v5.0.3
70+
with:
71+
path: |
72+
build/libs
73+
lib/llvm/src/compiler-rt/lib/builtins
74+
key: libs-windows-2025-${{ hashFiles('make.ps1', 'CMakeLists.txt', 'lib/CMakeLists.txt', 'lib/llvm/patches/*') }}
75+
- name: Build Libs
76+
if: steps.restore-libs.outputs.cache-hit != 'true'
77+
run: .\make.ps1 -Command libs
78+
- name: Build
79+
run: |
80+
.\make.ps1 -Command configure -Config Debug
81+
.\make.ps1 -Command build -Config Debug
82+
- name: Test pony-doc
83+
run: .\make.ps1 -Command test -Config Debug -TestsToRun pony-doc-tests
84+
- name: Test pony-lint
85+
run: .\make.ps1 -Command test -Config Debug -TestsToRun pony-lint-tests
86+
- name: Test pony-lsp
87+
run: .\make.ps1 -Command test -Config Debug -TestsToRun pony-lsp-tests

make.ps1

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,87 @@ switch ($Command.ToLower())
449449
}
450450
}
451451

452+
# pony-doc-tests
453+
if ($TestsToRun -match 'pony-doc-tests')
454+
{
455+
$numTestSuitesRun += 1;
456+
Write-Output "$outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-doc-tests -o $outDir $srcDir\tools\pony-doc\test"
457+
& $outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-doc-tests -o $outDir $srcDir\tools\pony-doc\test
458+
if ($LastExitCode -eq 0)
459+
{
460+
try
461+
{
462+
Write-Output "$outDir\pony-doc-tests.exe --sequential"
463+
& $outDir\pony-doc-tests.exe --sequential
464+
$err = $LastExitCode
465+
}
466+
catch
467+
{
468+
$err = -1
469+
}
470+
if ($err -ne 0) { $failedTestSuites += 'pony-doc-tests' }
471+
}
472+
else
473+
{
474+
$failedTestSuites += 'compile pony-doc-tests'
475+
}
476+
}
477+
478+
# pony-lint-tests
479+
if ($TestsToRun -match 'pony-lint-tests')
480+
{
481+
$numTestSuitesRun += 1;
482+
Write-Output "$outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-lint-tests -o $outDir $srcDir\tools\pony-lint\test"
483+
& $outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-lint-tests -o $outDir $srcDir\tools\pony-lint\test
484+
if ($LastExitCode -eq 0)
485+
{
486+
$savePonyPath = $env:PONYPATH
487+
$env:PONYPATH = "$srcDir\packages;$savePonyPath"
488+
try
489+
{
490+
Write-Output "$outDir\pony-lint-tests.exe --sequential"
491+
& $outDir\pony-lint-tests.exe --sequential
492+
$err = $LastExitCode
493+
}
494+
catch
495+
{
496+
$err = -1
497+
}
498+
$env:PONYPATH = $savePonyPath
499+
if ($err -ne 0) { $failedTestSuites += 'pony-lint-tests' }
500+
}
501+
else
502+
{
503+
$failedTestSuites += 'compile pony-lint-tests'
504+
}
505+
}
506+
507+
# pony-lsp-tests
508+
if ($TestsToRun -match 'pony-lsp-tests')
509+
{
510+
$numTestSuitesRun += 1;
511+
Write-Output "$outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\peg --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-lsp-tests -o $outDir $srcDir\tools"
512+
& $outDir\ponyc.exe --path $srcDir\tools\lib\ponylang\peg --path $srcDir\tools\lib\ponylang\pony_compiler\ -b pony-lsp-tests -o $outDir $srcDir\tools
513+
if ($LastExitCode -eq 0)
514+
{
515+
try
516+
{
517+
Write-Output "$outDir\pony-lsp-tests.exe --sequential"
518+
& $outDir\pony-lsp-tests.exe --sequential
519+
$err = $LastExitCode
520+
}
521+
catch
522+
{
523+
$err = -1
524+
}
525+
if ($err -ne 0) { $failedTestSuites += 'pony-lsp-tests' }
526+
}
527+
else
528+
{
529+
$failedTestSuites += 'compile pony-lsp-tests'
530+
}
531+
}
532+
452533
#
453534
$numTestSuitesFailed = $failedTestSuites.Length
454535
Write-Output "Test suites run: $numTestSuitesRun, num failed: $numTestSuitesFailed"

0 commit comments

Comments
 (0)