ci: add Native AOT / trim smoke test (#180) - #265
Merged
Conversation
Closes #180. New tests/Wolfgang.TryPattern.AotSmoke project (net10.0, PublishAot + PublishTrimmed + IsAotCompatible + TreatWarningsAsErrors, no test SDK — it's a compile+publish+run smoke). Program.cs exercises every public API on `Try` / `Result` / `Result<T>` (success + failure paths, sync + async, factories + combinators) and asserts the observed assertion count matches the expected count so a trimmed-away member manifests as a non-zero exit rather than a silent no-op. New aot-smoke.yaml standalone workflow (paths-filtered to src/ + smoke csproj + Directory.Build.props). Publishes for linux-x64 on ubuntu-latest, runs the produced native binary, fails on non-zero exit. Runs on `pull_request` (main + vNext), push-to-main, and manual dispatch. Standalone rather than folded into pr.yaml because AOT smoke doesn't need pr.yaml's trusted-config protection (no analyzer to silence via a permissive .editorconfig). Try-Pattern has no reflection / dynamic-code / serialization paths, so the entire surface is already AOT-safe by construction — this smoke is a regression backstop for future refactors that might inadvertently pull in an AOT-hostile dependency. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #180.
Summary
tests/Wolfgang.TryPattern.AotSmoke/project (net10.0,PublishAot=true,PublishTrimmed=true,IsAotCompatible=true,TreatWarningsAsErrors=true). Not a test project — a compile+publish+run smoke. Program.cs exercises every public API surface (Try.Run(Action), Try.Run, Try.RunAsync sync+async, Result factories/combinators, Result) both success and failure paths, and asserts observed count == expected count so trimmed-away members manifest as a non-zero exit..github/workflows/aot-smoke.yamlstandalone workflow. Publishes forlinux-x64onubuntu-latest, runs the native binary, fails on non-zero exit. Runs onpull_request(main + vNext), push-to-main, and manual dispatch. Standalone rather than folded into pr.yaml because it has no analyzer-silencing threat model.Stacked-PR base
Base =
vNext. Second of the 11-PR batch.Local dry-run
dotnet build tests/Wolfgang.TryPattern.AotSmoke -c Release: 0 warnings, 0 errors — the trim + AOT analyzers see no unsafe paths.dotnet publish -r win-x64locally fails at the platform-linker step (no VS C++ workload on this box) — expected; the CI Linux runner has the required toolchain.Protected-file guard
Adds a new workflow file (
.github/workflows/aot-smoke.yaml) → protected. Expected admin-bypass at merge, same pattern as PRs #256 / #257 / #258 / #261 / #262 / #263.Test plan
aot-smokejob runs on this PR and passes (build + publish + run)OK: AOT-safe surface passed N assertions under Native AOT.