Skip to content

Commit d1468c3

Browse files
ci: add Windows clippy job and fix cfg(windows) needless_return (#182)
Clippy previously ran only on Linux (lint-and-test's just lint-all), so Windows-only Rust code paths (#[cfg(target_os = "windows")] / WHP) in the host crate were never scanned. This adds a native Windows clippy job on the win2025 1ES pool running just lint-analysis-guest. It also fixes the pre-existing clippy::needless_return in host/src/sandbox.rs that the new job surfaces, turning the cfg(windows) WHP arm into a tail expression. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1a7ea63 commit d1468c3

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/pr-validate.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,34 @@ jobs:
161161
path: dist/
162162
retention-days: 7
163163

164+
# Lint Windows-only Rust code paths (cfg(target_os = "windows") / WHP) that
165+
# the Linux lint-and-test job never scans. Runs the analysis-guest clippy
166+
# natively on the Windows 1ES pool so cfg(windows) branches in the host crate
167+
# are checked under -D warnings.
168+
clippy-windows:
169+
name: Clippy (Windows)
170+
needs: [docs-pr]
171+
if: needs.docs-pr.outputs.docs-only != 'true'
172+
runs-on: [self-hosted, Windows, X64, "1ES.Pool=hld-win2025-amd", "JobId=clippy-windows-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"]
173+
steps:
174+
- uses: actions/checkout@v6
175+
176+
- uses: actions/setup-node@v6
177+
with:
178+
node-version: "22"
179+
180+
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
181+
with:
182+
rust-toolchain: "1.89"
183+
env:
184+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185+
186+
- name: Setup
187+
run: just setup
188+
189+
- name: Clippy (analysis-guest)
190+
run: just lint-analysis-guest
191+
164192
# PDF visual regression tests — run on a GitHub-hosted ubuntu-22.04 image
165193
# so goldens are pixel-matched against a reproducible, fork-accessible runner.
166194
# The update-golden.yml workflow uses the same image to regenerate baselines.
@@ -247,7 +275,7 @@ jobs:
247275
# Gate PR merges on all jobs passing
248276
ci-status:
249277
name: CI Status
250-
needs: [docs-pr, lint-and-test, build-and-test, pdf-visual, build-docker]
278+
needs: [docs-pr, lint-and-test, build-and-test, clippy-windows, pdf-visual, build-docker]
251279
if: always()
252280
runs-on: ubuntu-latest
253281
steps:

src/code-validator/guest/host/src/sandbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn check_hyperlight_availability() -> Result<String> {
191191
#[cfg(target_os = "windows")]
192192
{
193193
// WHP is always available on Windows 10+
194-
return Ok("whp".to_string());
194+
Ok("whp".to_string())
195195
}
196196

197197
#[cfg(not(target_os = "windows"))]

0 commit comments

Comments
 (0)