Skip to content

ci: add Native AOT / trim smoke test (#180) - #265

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/180-aot-smoke
Jul 17, 2026
Merged

ci: add Native AOT / trim smoke test (#180)#265
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/180-aot-smoke

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Closes #180.

Summary

  • New 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.
  • New .github/workflows/aot-smoke.yaml standalone workflow. Publishes for linux-x64 on ubuntu-latest, runs the 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 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-x64 locally 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-smoke job runs on this PR and passes (build + publish + run)
  • Native binary exits 0 with OK: AOT-safe surface passed N assertions under Native AOT.

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>
Copilot AI review requested due to automatic review settings July 16, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants