Skip to content

Commit e5419ea

Browse files
Check build exit code in analyzer smoke test
Previously, capturing dotnet build output into a variable swallowed its exit code, so failures unrelated to CS9057 (e.g. package restore errors) would silently pass. Now we check $LASTEXITCODE first.
1 parent dd4d598 commit e5419ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/dotnetBuild.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ jobs:
9696
# Build and check for CS9057 (analyzer references newer compiler than SDK provides)
9797
$output = dotnet build 2>&1
9898
$output | Write-Output
99+
if ($LASTEXITCODE -ne 0) {
100+
Write-Error "Build failed (exit code $LASTEXITCODE)"
101+
exit $LASTEXITCODE
102+
}
99103
if ($output -match 'CS9057') {
100104
Write-Error "CS9057 detected: Analyzer references a Roslyn version newer than this SDK supports"
101105
exit 1

0 commit comments

Comments
 (0)