Smoke test Windows cmd installer wrapper
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s
This commit is contained in:
@@ -88,6 +88,21 @@ jobs:
|
|||||||
$errors | ForEach-Object { Write-Error $_ }
|
$errors | ForEach-Object { Write-Error $_ }
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
- name: cmd installer smoke check
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$stub = Join-Path $PWD "dosh-install-smoke.ps1"
|
||||||
|
@'
|
||||||
|
param([string]$SmokeArg)
|
||||||
|
if ($SmokeArg -ne "ok") { throw "missing forwarded argument" }
|
||||||
|
$bindir = Join-Path $env:TEMP "dosh-smoke-bin"
|
||||||
|
if ($env:DOSH_INSTALL_BINDIR_FILE) {
|
||||||
|
[System.IO.File]::WriteAllText($env:DOSH_INSTALL_BINDIR_FILE, $bindir, [System.Text.Encoding]::ASCII)
|
||||||
|
}
|
||||||
|
'@ | Set-Content -Encoding ascii -NoNewline $stub
|
||||||
|
$cmd = 'set "DOSH_INSTALL_PS1={0}"&& call install.cmd ok&& echo ;!PATH!; | find /I ";{1}\dosh-smoke-bin;"' -f $stub, $env:TEMP
|
||||||
|
cmd /d /v:on /c $cmd
|
||||||
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||||
- name: Build Windows client
|
- name: Build Windows client
|
||||||
run: cargo build --release --bin dosh-client --bin dosh-bench
|
run: cargo build --release --bin dosh-client --bin dosh-bench
|
||||||
- name: Test Windows client
|
- name: Test Windows client
|
||||||
|
|||||||
+5
-1
@@ -22,7 +22,11 @@ set "DOSH_INSTALL_PS1_URL=%SCRIPT_URL%"
|
|||||||
set "DOSH_INSTALL_PS1_PATH=%TMP_PS%"
|
set "DOSH_INSTALL_PS1_PATH=%TMP_PS%"
|
||||||
set "DOSH_INSTALL_BINDIR_FILE=%TMP_BINDIR%"
|
set "DOSH_INSTALL_BINDIR_FILE=%TMP_BINDIR%"
|
||||||
|
|
||||||
"%PS%" -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; Invoke-WebRequest -UseBasicParsing -Uri $env:DOSH_INSTALL_PS1_URL -OutFile $env:DOSH_INSTALL_PS1_PATH"
|
if exist "%SCRIPT_URL%" (
|
||||||
|
copy /Y "%SCRIPT_URL%" "%TMP_PS%" >nul
|
||||||
|
) else (
|
||||||
|
"%PS%" -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; Invoke-WebRequest -UseBasicParsing -Uri $env:DOSH_INSTALL_PS1_URL -OutFile $env:DOSH_INSTALL_PS1_PATH"
|
||||||
|
)
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
del "%TMP_PS%" >nul 2>nul
|
del "%TMP_PS%" >nul 2>nul
|
||||||
del "%TMP_BINDIR%" >nul 2>nul
|
del "%TMP_BINDIR%" >nul 2>nul
|
||||||
|
|||||||
@@ -100,6 +100,13 @@ fn release_gates_test_all_targets() {
|
|||||||
.contains("[System.Management.Automation.Language.Parser]::ParseFile(\"install.ps1\""),
|
.contains("[System.Management.Automation.Language.Parser]::ParseFile(\"install.ps1\""),
|
||||||
"Windows CI must parse the installer with PowerShell"
|
"Windows CI must parse the installer with PowerShell"
|
||||||
);
|
);
|
||||||
|
assert!(
|
||||||
|
windows_client.contains("name: cmd installer smoke check")
|
||||||
|
&& windows_client.contains("DOSH_INSTALL_PS1=")
|
||||||
|
&& windows_client.contains("call install.cmd ok")
|
||||||
|
&& windows_client.contains("find /I \";{1}\\dosh-smoke-bin;\""),
|
||||||
|
"Windows CI must execute the cmd wrapper against a local installer stub"
|
||||||
|
);
|
||||||
assert!(
|
assert!(
|
||||||
windows_client.contains("run: cargo test --all-targets"),
|
windows_client.contains("run: cargo test --all-targets"),
|
||||||
"Windows CI must run Rust tests, not only build/package"
|
"Windows CI must run Rust tests, not only build/package"
|
||||||
@@ -259,6 +266,8 @@ fn windows_cmd_installer_wraps_native_powershell_installer() {
|
|||||||
assert!(cmd.contains("for %%P in (powershell.exe pwsh.exe powershell pwsh) do"));
|
assert!(cmd.contains("for %%P in (powershell.exe pwsh.exe powershell pwsh) do"));
|
||||||
assert!(cmd.contains("set \"TMP_BINDIR=%TEMP%\\dosh-install-%RANDOM%-%RANDOM%.bindir\""));
|
assert!(cmd.contains("set \"TMP_BINDIR=%TEMP%\\dosh-install-%RANDOM%-%RANDOM%.bindir\""));
|
||||||
assert!(cmd.contains("set \"DOSH_INSTALL_BINDIR_FILE=%TMP_BINDIR%\""));
|
assert!(cmd.contains("set \"DOSH_INSTALL_BINDIR_FILE=%TMP_BINDIR%\""));
|
||||||
|
assert!(cmd.contains("if exist \"%SCRIPT_URL%\" ("));
|
||||||
|
assert!(cmd.contains("copy /Y \"%SCRIPT_URL%\" \"%TMP_PS%\""));
|
||||||
assert!(cmd.contains("Invoke-WebRequest -UseBasicParsing"));
|
assert!(cmd.contains("Invoke-WebRequest -UseBasicParsing"));
|
||||||
assert!(cmd.contains("-ExecutionPolicy Bypass -File \"%TMP_PS%\" %*"));
|
assert!(cmd.contains("-ExecutionPolicy Bypass -File \"%TMP_PS%\" %*"));
|
||||||
assert!(cmd.contains(
|
assert!(cmd.contains(
|
||||||
|
|||||||
Reference in New Issue
Block a user