@@ -56,43 +56,31 @@ jobs:
5656 steps :
5757 - uses : actions/checkout@v4
5858
59- - name : Run bash install script
59+ - name : Run install and verify
6060 run : |
6161 export HOME="$(mktemp -d)"
62- chmod +x install-extensions.sh
6362 ./install-extensions.sh
6463
65- - name : Verify installed files
66- run : |
67- export HOME="$(cat /proc/self/environ | tr '\0' '\n' | grep '^HOME=' | head -1 | cut -d= -f2)"
68- # Re-run with same isolated HOME
69- ISOLATED_HOME="$(mktemp -d)"
70- HOME="$ISOLATED_HOME" ./install-extensions.sh
71-
7264 echo "Checking installed files..."
73- test -f "$ISOLATED_HOME /.copilot/extensions/ado-pr-watcher/extension.mjs" || { echo "::error::ado-pr-watcher/extension.mjs missing"; exit 1; }
74- test -f "$ISOLATED_HOME /.copilot/extensions/ado-pr-watcher/common.mjs" || { echo "::error::ado-pr-watcher/common.mjs missing"; exit 1; }
75- test -f "$ISOLATED_HOME /.copilot/extensions/ado-pr-watcher/integration.mjs" || { echo "::error::ado-pr-watcher/integration.mjs missing"; exit 1; }
76- test -f "$ISOLATED_HOME /.copilot/extensions/ado-pr-watcher/worker.mjs" || { echo "::error::ado-pr-watcher/worker.mjs missing"; exit 1; }
77- test -f "$ISOLATED_HOME /.copilot/extensions/ado-build-watcher/extension.mjs" || { echo "::error::ado-build-watcher/extension.mjs missing"; exit 1; }
78- test -f "$ISOLATED_HOME /.copilot/extensions/ado-build-watcher/common.mjs" || { echo "::error::ado-build-watcher/common.mjs missing"; exit 1; }
79- test -f "$ISOLATED_HOME /.copilot/extensions/ado-build-watcher/watcher-worker.mjs" || { echo "::error::ado-build-watcher/watcher-worker.mjs missing"; exit 1; }
80- test -f "$ISOLATED_HOME /.copilot/extensions/lib/tab-indicator.mjs" || { echo "::error::lib/tab-indicator.mjs missing"; exit 1; }
65+ test -f "$HOME /.copilot/extensions/ado-pr-watcher/extension.mjs" || { echo "::error::ado-pr-watcher/extension.mjs missing"; exit 1; }
66+ test -f "$HOME /.copilot/extensions/ado-pr-watcher/common.mjs" || { echo "::error::ado-pr-watcher/common.mjs missing"; exit 1; }
67+ test -f "$HOME /.copilot/extensions/ado-pr-watcher/integration.mjs" || { echo "::error::ado-pr-watcher/integration.mjs missing"; exit 1; }
68+ test -f "$HOME /.copilot/extensions/ado-pr-watcher/worker.mjs" || { echo "::error::ado-pr-watcher/worker.mjs missing"; exit 1; }
69+ test -f "$HOME /.copilot/extensions/ado-build-watcher/extension.mjs" || { echo "::error::ado-build-watcher/extension.mjs missing"; exit 1; }
70+ test -f "$HOME /.copilot/extensions/ado-build-watcher/common.mjs" || { echo "::error::ado-build-watcher/common.mjs missing"; exit 1; }
71+ test -f "$HOME /.copilot/extensions/ado-build-watcher/watcher-worker.mjs" || { echo "::error::ado-build-watcher/watcher-worker.mjs missing"; exit 1; }
72+ test -f "$HOME /.copilot/extensions/lib/tab-indicator.mjs" || { echo "::error::lib/tab-indicator.mjs missing"; exit 1; }
8173 echo "All expected files present"
8274
8375 - name : Verify idempotence (stale files removed)
8476 run : |
85- ISOLATED_HOME="$(mktemp -d)"
86- HOME="$ISOLATED_HOME" ./install-extensions.sh
87-
88- # Create a stale file in one extension dir
89- touch "$ISOLATED_HOME/.copilot/extensions/ado-pr-watcher/old-stale-file.mjs"
77+ export HOME="$(mktemp -d)"
78+ ./install-extensions.sh
9079
91- # Re-run installer
92- HOME="$ISOLATED_HOME" ./install-extensions.sh
80+ touch "$HOME/.copilot/extensions/ado-pr-watcher/old-stale-file.mjs"
81+ ./install-extensions.sh
9382
94- # Stale file should be gone
95- if [ -f "$ISOLATED_HOME/.copilot/extensions/ado-pr-watcher/old-stale-file.mjs" ]; then
83+ if [ -f "$HOME/.copilot/extensions/ado-pr-watcher/old-stale-file.mjs" ]; then
9684 echo "::error::Stale file survived reinstall — installer is not idempotent"
9785 exit 1
9886 fi
@@ -104,13 +92,7 @@ jobs:
10492 steps :
10593 - uses : actions/checkout@v4
10694
107- - name : Run PowerShell install script
108- shell : pwsh
109- run : |
110- $env:HOME = (New-Item -ItemType Directory -Path (Join-Path ([System.IO.Path]::GetTempPath()) "copilot-test-$(Get-Random)")).FullName
111- ./install-extensions.ps1
112-
113- - name : Verify installed files
95+ - name : Run install and verify
11496 shell : pwsh
11597 run : |
11698 $isolatedHome = (New-Item -ItemType Directory -Path (Join-Path ([System.IO.Path]::GetTempPath()) "copilot-test-$(Get-Random)")).FullName
@@ -127,7 +109,7 @@ jobs:
127109 "ado-build-watcher/watcher-worker.mjs",
128110 "lib/tab-indicator.mjs"
129111 )
130- $extDir = Join-Path $isolatedHome ".copilot" "extensions"
112+ $extDir = Join-Path (Join-Path $isolatedHome ".copilot") "extensions"
131113 $missing = $expected | Where-Object { -not (Test-Path (Join-Path $extDir $_)) }
132114 if ($missing) {
133115 $missing | ForEach-Object { Write-Error "Missing: $_" }
@@ -142,11 +124,10 @@ jobs:
142124 $env:HOME = $isolatedHome
143125 ./install-extensions.ps1
144126
145- # Create stale file
146- $stale = Join-Path $isolatedHome ".copilot" "extensions" "ado-pr-watcher" "old-stale-file.mjs"
127+ $prDir = Join-Path (Join-Path (Join-Path $isolatedHome ".copilot") "extensions") "ado-pr-watcher"
128+ $stale = Join-Path $prDir "old-stale-file.mjs"
147129 "" | Set-Content $stale
148130
149- # Reinstall
150131 ./install-extensions.ps1
151132
152133 if (Test-Path $stale) {
@@ -178,7 +159,7 @@ jobs:
178159 "ado-build-watcher\watcher-worker.mjs",
179160 "lib\tab-indicator.mjs"
180161 )
181- $extDir = Join-Path $isolatedHome.FullName ".copilot" "extensions"
162+ $extDir = Join-Path (Join-Path $isolatedHome.FullName ".copilot") "extensions"
182163 $missing = $expected | Where-Object { -not (Test-Path (Join-Path $extDir $_)) }
183164 if ($missing) {
184165 $missing | ForEach-Object { Write-Error "Missing: $_" }
0 commit comments