ci: run unit tests under Native AOT#374
Conversation
Greptile SummaryThis PR adds a new GitHub Actions workflow (
Confidence Score: 4/5The workflow is safe to merge; it adds CI coverage without touching any library or test source code. The workflow is straightforward and consistent with the existing CI patterns in this repo. The only notable gap is that net9.0 — a framework the test project explicitly targets — is not included in the AOT matrix, which means a future net9.0-specific regression could slip through undetected. The rationale for skipping it is explained in the PR description but not in the workflow file itself. .github/workflows/aot.yml — specifically the matrix definition and the absence of a comment explaining why net9.0 is excluded despite being a targeted framework. Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant CO as actions/checkout@v7
participant SDK as actions/setup-dotnet@v6
participant CLI as dotnet CLI
participant BIN as AOT Binary
GH->>CO: Checkout repo (persist-credentials: false)
GH->>SDK: Install .NET 10.0.x SDK
loop matrix: [net8.0, net10.0]
GH->>CLI: "dotnet publish -f {framework} -r linux-x64 -c Release -p:PublishAot=true"
CLI-->>GH: "Native binary at bin/Release/{framework}/linux-x64/publish/"
GH->>BIN: Execute binary (Microsoft.Testing.Platform)
BIN-->>GH: Exit 0 (all tests pass) / non-zero (failure)
end
Reviews (1): Last reviewed commit: "ci: run unit tests under Native AOT" | Re-trigger Greptile |
| framework: [net8.0, net10.0] | ||
|
|
There was a problem hiding this comment.
The test project targets net8.0;net9.0;net10.0 (see EnumerableAsyncProcessor.UnitTests.csproj), but the matrix skips net9.0. The PR description explains the rationale (net8 covers the pre-net9 streaming path; net10 covers Task.WhenEach), but net9.0 is a distinct TFM with its own runtime behaviour and could have different AOT trimming characteristics. If a net9.0-specific code path is ever added, it would fall through this gate silently. Worth at least a brief inline comment in the matrix entry explaining why net9.0 is intentionally absent.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Adds
.github/workflows/aot.yml: publishesEnumerableAsyncProcessor.UnitTestswithPublishAot=trueand runs the native binary, verifying the library's runtime behaviour under Native AOT (IsAotCompatibleonly runs compile-time analyzers).net8.0andnet10.0— net8.0 also exercises the pre-net9 completion-order streaming path inToIAsyncEnumerable; net10.0 covers theTask.WhenEachpath.Notes
IL2026warnings, all from TUnit'sIsEquivalentTo(RequiresUnreferencedCodefor structural comparison). Usages here are primitive collections, so they should behave correctly under AOT; warnings left visible rather than suppressed.