-
Notifications
You must be signed in to change notification settings - Fork 737
214 lines (184 loc) · 7.16 KB
/
windows-smoke.yml
File metadata and controls
214 lines (184 loc) · 7.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Windows Smoke
on:
workflow_dispatch:
inputs:
target:
description: Windows target to verify
required: true
default: x64
type: choice
options:
- x64
- arm64
- both
concurrency:
group: windows-smoke-${{ github.ref }}-${{ github.event.inputs.target || 'x64' }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
jobs:
smoke-x64:
name: Windows Smoke (x64)
if: github.event.inputs.target == 'x64' || github.event.inputs.target == 'both'
runs-on: windows-latest
timeout-minutes: 150
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: mozilla-actions/sccache-action@v0.0.7
continue-on-error: true
- uses: Swatinem/rust-cache@v2
with:
key: windows-smoke-x64
cache-all-crates: "true"
- name: Build release binary
shell: pwsh
run: |
if (Get-Command sccache -ErrorAction SilentlyContinue) {
sccache --start-server *> $null
if ($LASTEXITCODE -eq 0) {
$env:RUSTC_WRAPPER = 'sccache'
}
}
& cargo build --locked --release --target x86_64-pc-windows-msvc
- name: Compile library and binary tests
shell: pwsh
run: |
& cargo test --locked --target x86_64-pc-windows-msvc --lib --bins --no-run
if ($LASTEXITCODE -ne 0) {
throw 'Windows library/binary test compilation failed'
}
- name: Run targeted Windows validation tests
shell: pwsh
run: |
$tests = @(
'command_candidates_adds_extension_on_windows',
'command_exists_for_known_binary',
'command_exists_absolute_path',
'sibling_socket_path_roundtrip',
'cleanup_socket_pair_removes_main_and_debug_files',
'is_process_running_reports_exited_children_as_stopped',
'spawn_replacement_process_returns_without_waiting_for_child_exit',
'build_shell_command_uses_cmd_and_executes_command',
'pipe_name_is_stable_and_normalizes_case_and_separators',
'pipe_name_falls_back_when_stem_is_empty',
'stream_pair_round_trips_bytes',
'auto_provider_noninteractive_skips_untrusted_external_auth_instead_of_blocking'
)
foreach ($testName in $tests) {
& ./scripts/invoke_cargo_with_timeout.ps1 `
-Name "Windows targeted test: $testName" `
-TimeoutSeconds 300 `
-CargoArgs @('test', '--locked', '--target', 'x86_64-pc-windows-msvc', '--lib', $testName, '--', '--nocapture')
}
- name: Run Windows smoke tests
shell: pwsh
run: |
$tests = @(
'provider_behavior::test_socket_model_cycle_supported_models',
'provider_behavior::test_model_switch_resets_provider_session'
)
foreach ($testName in $tests) {
& ./scripts/invoke_cargo_with_timeout.ps1 `
-Name "Windows e2e smoke test: $testName" `
-TimeoutSeconds 420 `
-CargoArgs @('test', '--locked', '--target', 'x86_64-pc-windows-msvc', '--test', 'e2e', $testName, '--', '--exact', '--nocapture')
}
- name: Run Windows lifecycle e2e tests
shell: pwsh
env:
JCODE_E2E_ARTIFACT_DIR: ${{ runner.temp }}/jcode-windows-e2e-logs
run: |
New-Item -ItemType Directory -Force -Path $env:JCODE_E2E_ARTIFACT_DIR | Out-Null
$tests = @(
'windows_lifecycle::windows_binary_server_accepts_clients_and_debug_cli',
'windows_lifecycle::windows_binary_server_rebinds_named_pipe_after_exit'
)
foreach ($testName in $tests) {
& ./scripts/invoke_cargo_with_timeout.ps1 `
-Name "Windows lifecycle e2e test: $testName" `
-TimeoutSeconds 420 `
-CargoArgs @('test', '--locked', '--target', 'x86_64-pc-windows-msvc', '--test', 'e2e', $testName, '--', '--exact', '--nocapture')
}
- name: Upload Windows e2e diagnostics
if: failure()
uses: actions/upload-artifact@v4
with:
name: windows-smoke-e2e-diagnostics-x64
path: ${{ runner.temp }}/jcode-windows-e2e-logs
if-no-files-found: ignore
- name: Verify built binary launches
shell: pwsh
run: |
& "target/x86_64-pc-windows-msvc/release/jcode.exe" --version
if ($LASTEXITCODE -ne 0) {
throw 'Built Windows binary failed to run --version'
}
- name: Verify installer using local artifact
shell: pwsh
run: |
$cargoVersion = Select-String -Path Cargo.toml -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1
if (-not $cargoVersion) {
throw 'Could not determine Cargo.toml version'
}
$version = 'v' + $cargoVersion.Matches[0].Groups[1].Value
& ./.github/scripts/verify_windows_install.ps1 `
-ArtifactExePath 'target/x86_64-pc-windows-msvc/release/jcode.exe' `
-Version $version
smoke-arm64:
name: Windows Smoke (ARM64)
if: github.event.inputs.target == 'arm64' || github.event.inputs.target == 'both'
runs-on: windows-11-arm
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-pc-windows-msvc
- uses: mozilla-actions/sccache-action@v0.0.7
continue-on-error: true
- uses: Swatinem/rust-cache@v2
with:
key: windows-smoke-arm64
cache-all-crates: "true"
- name: Build release binary
shell: pwsh
run: |
if (Get-Command sccache -ErrorAction SilentlyContinue) {
sccache --start-server *> $null
if ($LASTEXITCODE -eq 0) {
$env:RUSTC_WRAPPER = 'sccache'
}
}
& cargo build --locked --release --target aarch64-pc-windows-msvc --no-default-features --features pdf
- name: Verify built binary launches
shell: pwsh
run: |
& "target/aarch64-pc-windows-msvc/release/jcode.exe" --version
if ($LASTEXITCODE -ne 0) {
throw 'Built Windows ARM64 binary failed to run --version'
}
- name: Verify installer using local artifact
shell: pwsh
run: |
$cargoVersion = Select-String -Path Cargo.toml -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1
if (-not $cargoVersion) {
throw 'Could not determine Cargo.toml version'
}
$version = 'v' + $cargoVersion.Matches[0].Groups[1].Value
& ./.github/scripts/verify_windows_install.ps1 `
-ArtifactExePath 'target/aarch64-pc-windows-msvc/release/jcode.exe' `
-Version $version