Skip to content

Commit 7293fa5

Browse files
authored
Merge pull request #10544 from Extra-Chill/fix/10543-release-windows-contract
Align Windows release contract with current policy
2 parents a5cb1e0 + b4e2cd1 commit 7293fa5

2 files changed

Lines changed: 18 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ jobs:
3838
- name: Compile all workspace test targets
3939
run: cargo check --workspace --tests --locked
4040

41-
# Fail-fast mirror of the release `Windows Build` gate. Unix-only `libc`
42-
# constants (`SIGKILL` has no Windows definition) and other cfg-gating misses
43-
# compile fine on Linux, so they only surfaced after merge when the release
44-
# workflow ran `cargo build --workspace` on windows-latest and turned `main`
45-
# red (#10398). Same crate scope as that gate, but codegen-free so it stays
46-
# cheap enough to run on every PR. Deliberately no `--tests`: the release gate
47-
# does not build test targets, and some Unix-only test helpers rely on that.
41+
# Unix-only `libc` constants (`SIGKILL` has no Windows definition) and other
42+
# cfg-gating misses compile fine on Linux (#10398). The release has no Windows
43+
# artifact consumer, so keep this codegen-free source check on every PR rather
44+
# than paying for a native release build. Deliberately no `--tests`: some
45+
# Unix-only test helpers rely on that boundary.
4846
windows-compile:
4947
name: homeboy / Windows Compile
5048
runs-on: windows-latest

tests/release_workflow_test.rs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ fn release_workflow() -> &'static str {
22
include_str!("../.github/workflows/release.yml")
33
}
44

5+
fn ci_workflow() -> &'static str {
6+
include_str!("../.github/workflows/ci.yml")
7+
}
8+
59
fn release_quality_policy_script() -> &'static str {
610
include_str!("../.github/release-quality-policy.sh")
711
}
@@ -266,29 +270,20 @@ fn release_preflight_validates_the_private_workspace_build_before_mutating_relea
266270
}
267271

268272
#[test]
269-
fn release_blocks_preparation_and_publication_on_a_native_windows_workspace_build() {
270-
let windows_build = job_section(release_workflow(), "gate-windows-build");
271-
let quality_policy = job_section(release_workflow(), "release-quality-policy");
272-
let prepare = job_section(release_workflow(), "prepare");
273+
fn release_omits_unused_windows_artifacts_while_ci_checks_windows_source() {
274+
let release = release_workflow();
275+
let windows_compile = job_section(ci_workflow(), "windows-compile");
273276

274-
assert!(windows_build.contains("runs-on: windows-latest"));
275-
assert!(windows_build.contains("run: cargo build --workspace --locked"));
276-
assert!(
277-
quality_policy.contains("- gate-windows-build"),
278-
"the release quality policy must wait for the native Windows build"
279-
);
280-
assert!(
281-
quality_policy.contains("needs.gate-windows-build.result == 'success'"),
282-
"the release quality policy must fail closed when the native Windows build fails"
283-
);
284277
assert!(
285-
prepare.contains("- gate-windows-build"),
286-
"release preparation must wait for the native Windows build"
278+
!release.contains("gate-windows-build"),
279+
"release must not restore the unused native Windows artifact gate"
287280
);
288281
assert!(
289-
prepare.contains("needs.gate-windows-build.result == 'success'"),
290-
"a failed native Windows build must prevent tag preparation and publication"
282+
!dist_workspace_manifest().contains("x86_64-pc-windows-msvc"),
283+
"release must not publish an unconsumed Windows artifact"
291284
);
285+
assert!(windows_compile.contains("runs-on: windows-latest"));
286+
assert!(windows_compile.contains("run: cargo check --workspace --locked"));
292287
}
293288

294289
#[test]

0 commit comments

Comments
 (0)