Skip to content

Commit 7f0aef8

Browse files
committed
fix: enhance Windows CI workflow with short workspace mapping and improved test handling
Signed-off-by: Gordon Smith <[email protected]>
1 parent 1740d8d commit 7f0aef8

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

.github/workflows/windows.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
with:
3232
submodules: recursive
3333

34+
- name: Create short workspace mapping
35+
run: |
36+
$winPath = (Get-Location).Path
37+
cmd /c ("subst T: ""{0}""" -f $winPath)
38+
Add-Content -Path $env:GITHUB_ENV -Value "SHORT_WORKSPACE=T:/"
39+
3440
- name: Cache Cargo registry
3541
uses: actions/cache@v4
3642
with:
@@ -60,30 +66,47 @@ jobs:
6066

6167
- name: Install rust dependencies
6268
run: |
63-
cargo install wasm-tools wit-bindgen-cli || true
69+
Set-Location "$env:SHORT_WORKSPACE"
70+
& cargo install wasm-tools wit-bindgen-cli
71+
if ($LASTEXITCODE -ne 0) {
72+
Write-Host "cargo install exited with code $LASTEXITCODE (ignored)."
73+
$global:LASTEXITCODE = 0
74+
}
6475
6576
- name: configure
6677
run: |
67-
cmake --preset ${{ matrix.config }}
78+
Set-Location "$env:SHORT_WORKSPACE"
79+
& cmake --preset ${{ matrix.config }}
6880
6981
- name: build
7082
run: |
71-
cmake --build --preset ${{ matrix.build }}
83+
Set-Location "$env:SHORT_WORKSPACE"
84+
& cmake --build --preset ${{ matrix.build }}
7285
7386
- name: test
7487
working-directory: build
7588
run: |
76-
ctest -C Debug -VV
89+
Set-Location "$env:SHORT_WORKSPACE/build"
90+
& ctest -C Debug -VV
7791
7892
- name: test-stubs-full (allowed to fail)
79-
working-directory: build
8093
continue-on-error: true
81-
shell: bash
8294
run: |
83-
echo "Running wit-stub-generation-test (failures expected and will be reported)..."
84-
ctest -C Debug -VV -R "wit-stub-generation-test" > test_output.txt 2>&1 || true
85-
cat test_output.txt
86-
../.github/scripts/summarize-test-failures.sh test_output.txt test_summary.md
95+
Set-Location "$env:SHORT_WORKSPACE/build"
96+
Write-Host "Running wit-stub-generation-test (failures expected and will be reported)..."
97+
& ctest -C Debug -VV -R "wit-stub-generation-test" *> test_output.txt
98+
$ctestExit = $LASTEXITCODE
99+
if ($ctestExit -ne 0) {
100+
Write-Host "ctest exited with code $ctestExit (allowed to fail)."
101+
$global:LASTEXITCODE = 0
102+
}
103+
Get-Content test_output.txt
104+
bash "$env:SHORT_WORKSPACE/.github/scripts/summarize-test-failures.sh" test_output.txt test_summary.md
105+
106+
- name: Remove short workspace mapping
107+
if: always()
108+
run: |
109+
cmd /c "subst T: /D" 2>$null
87110
88111
- name: Upload error logs
89112
if: ${{ failure() || cancelled() }}

0 commit comments

Comments
 (0)