Skip to content

Commit 999f317

Browse files
authored
chore(ci): isolate Windows snapshot workspaces
1 parent b869450 commit 999f317

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,17 @@ jobs:
11021102
with:
11031103
tool: cargo-nextest
11041104

1105+
# Keep fixtures outside runner.temp: setup-node writes an .npmrc there,
1106+
# which Yarn Classic discovers when walking parent directories.
1107+
- name: Create NTFS snapshot temp directory
1108+
id: snapshot-temp
1109+
shell: pwsh
1110+
run: |
1111+
$volume = [System.IO.Path]::GetPathRoot($env:RUNNER_TEMP)
1112+
$snapshotTemp = Join-Path $volume ('vp-snapshots-' + [guid]::NewGuid().ToString('N'))
1113+
New-Item -ItemType Directory -Path $snapshotTemp | Out-Null
1114+
"directory=$snapshotTemp" >> $env:GITHUB_OUTPUT
1115+
11051116
# `cargo-nextest` is invoked directly so the job never depends on the
11061117
# runner's Rust toolchain. --workspace-remap makes nextest rewrite
11071118
# CARGO_MANIFEST_DIR and CARGO_BIN_EXE_vpt to this checkout, which is
@@ -1127,7 +1138,7 @@ jobs:
11271138
# Rust's GetTempPath2 ignores TEMP/TMP under the SYSTEM account.
11281139
# Use the runner's NTFS workspace volume: C:\Windows\SystemTemp
11291140
# rejects the case-sensitive directory flag on these hosts.
1130-
SystemTemp: ${{ runner.temp }}
1141+
SystemTemp: ${{ steps.snapshot-temp.outputs.directory }}
11311142
# Keep Windows env parity with the `test` recipe in justfile.
11321143
__COMPAT_LAYER: RunAsInvoker
11331144

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const fs = require('node:fs');
2+
3+
fs.mkdirSync('node_modules/.bin', { recursive: true });
4+
fs.writeFileSync('node_modules/.bin/astro.CMD', '@echo wrong workspace shim %*\r\n');

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/windows_case_sensitive_shims/snapshots.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ steps = [
77
{ argv = ["node", "setup.cjs"], snapshot = false },
88
{ argv = ["vp", "run", "probe"], tty = false, comment = "Nested task planning resolves the lowercase shim with uppercase PATHEXT." },
99
{ argv = ["vp", "exec", "astro", "--version"], cwd = "packages/app", tty = false },
10-
{ argv = ["vpt", "write-file", "node_modules/.bin/astro.CMD", "@echo wrong workspace shim %*"], snapshot = false },
10+
{ argv = ["node", "later-shim.cjs"], snapshot = false },
1111
{ argv = ["vp", "run", "probe"], tty = false, comment = "The earlier package-local lowercase shim wins over a later uppercase shim." },
1212
{ argv = ["vp", "exec", "astro", "--version"], cwd = "packages/app", tty = false },
1313
{ argv = ["vp", "run", "cached"], cwd = "packages/app", tty = false },

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/windows_case_sensitive_shims/snapshots/windows_case_sensitive_shims.global.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local shim --version
1818
local shim --version
1919
```
2020

21-
## `vpt write-file node_modules/.bin/astro.CMD "@echo wrong workspace shim %*"`
21+
## `node later-shim.cjs`
2222

2323

2424
## `vp run probe`

crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/windows_case_sensitive_shims/snapshots/windows_case_sensitive_shims.local.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local shim --version
1818
local shim --version
1919
```
2020

21-
## `vpt write-file node_modules/.bin/astro.CMD "@echo wrong workspace shim %*"`
21+
## `node later-shim.cjs`
2222

2323

2424
## `vp run probe`

0 commit comments

Comments
 (0)