Skip to content

Commit fcbba47

Browse files
committed
ci(windows): split into dedicated test-windows job
The previous "windows-latest in test matrix" approach fails at step 1 (\`./pkgm.ts i git\`) because Windows doesn't interpret shebangs. Guarding ~25 POSIX-style steps with \`if: runner.os != 'Windows'\` would be noise; the existing job stays POSIX-only. Add a focused \`test-windows\` job that invokes pkgm via the explicit form a user without the (not-yet-existing) \`pkgm.cmd\` wrapper would use: pkgx deno^2.1 run --ext=ts --allow-... ./pkgm.ts <args> Two smoke steps: 1. \`pkgm --version\` — floor test that pkgx is on PATH, deno can run the script, libpkgx imports resolve on Windows, parseArgs reaches the version arm. 2. \`pkgm i hyperfine\` — exercises the install end-to-end. Expected to surface either pantry-resolution / hardlink-fallback / .cmd- emission gaps. continue-on-error: true while iterating. Verifies the expected cache landing site is %LOCALAPPDATA%\pkgm\pkgs.
1 parent ce6da9b commit fcbba47

1 file changed

Lines changed: 52 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,10 @@ jobs:
2727
test:
2828
continue-on-error: true
2929
strategy:
30-
fail-fast: false
3130
matrix:
3231
os:
3332
- macos-latest
3433
- ubuntu-latest
35-
# Windows: scaffolding pass — steps below rely on shebang
36-
# interpretation and POSIX paths, so most will fail until
37-
# pkgm grows native Windows install/stub support. See the
38-
# draft PR description for the open design questions.
39-
- windows-latest
4034
runs-on: ${{ matrix.os }}
4135
steps:
4236
- uses: actions/checkout@v4
@@ -115,6 +109,58 @@ jobs:
115109
./pkgm.ts i spotify_player
116110
spotify_player --version
117111
112+
# Scaffolding-pass smoke test for the Windows port. Uses an explicit
113+
# `pkgx deno^2.1 run` invocation because the kernel doesn't interpret
114+
# `#!/usr/bin/env -S pkgx …` shebangs on Windows; a `pkgm.cmd` wrapper
115+
# that papers over this belongs in pkgxdev/setup's installer.ps1, not
116+
# here. continue-on-error: true while the port is in progress.
117+
test-windows:
118+
continue-on-error: true
119+
runs-on: windows-latest
120+
defaults:
121+
run:
122+
shell: pwsh
123+
steps:
124+
- uses: actions/checkout@v4
125+
- uses: pkgxdev/setup@v4
126+
127+
- name: smoke - pkgm --version
128+
# Verifies the absolute floor: pkgx is on PATH, deno can run
129+
# the script, libpkgx imports resolve on Windows, parseArgs +
130+
# the `version` arm exit 0. No filesystem touching yet.
131+
run: |
132+
$denoArgs = @(
133+
'deno^2.1', 'run', '--ext=ts',
134+
'--allow-sys=uid', '--allow-run', '--allow-env',
135+
'--allow-read', '--allow-write', '--allow-ffi',
136+
'--allow-net=dist.pkgx.dev',
137+
'./pkgm.ts', '--version'
138+
)
139+
pkgx @denoArgs
140+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
141+
142+
- name: smoke - install hyperfine
143+
# Exercises the install path end-to-end on Windows. Expected to
144+
# fail at one of: pantry resolution (if no Windows build), the
145+
# hardlink-fallback path in symlink_with_overwrite, or the .cmd
146+
# emission step. Failure mode is the discovery signal for the
147+
# next iteration.
148+
run: |
149+
$denoArgs = @(
150+
'deno^2.1', 'run', '--ext=ts',
151+
'--allow-sys=uid', '--allow-run', '--allow-env',
152+
'--allow-read', '--allow-write', '--allow-ffi',
153+
'--allow-net=dist.pkgx.dev',
154+
'./pkgm.ts', 'i', 'hyperfine'
155+
)
156+
pkgx @denoArgs
157+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
158+
$expected = Join-Path $env:LOCALAPPDATA "pkgm\pkgs\crates.io\hyperfine"
159+
if (!(Test-Path $expected)) {
160+
Write-Error "expected hyperfine cache at $expected"
161+
exit 1
162+
}
163+
118164
# Validates `sudo pkgm install` behaviour fixed in 2b33f20:
119165
# - privilege drop so pkgx cache stays owned by $SUDO_USER, not root
120166
# - HOME override so the cache lands under the invoking user's tree

0 commit comments

Comments
 (0)