.NET CI Workflow
Purpose
Make .NET CI prove the same behavior maintainers care about locally.
The practical job is to choose SDK setup, restore/build/test commands, optional format/package checks, path filters, and matrix scope without making CI broader or noisier than the project needs.
When To Use
- Use this skill when adding or changing CI for a .NET repository.
- Use this skill when local validation and CI disagree.
- Use this skill when adding F# or C# projects to an existing CI workflow.
- Use this skill before package or release workflows depend on CI results.
Source Check
Use repo-local files, checked-out dependency sources, Dash MCP or Dash HTTP for installed docsets, and then official project documentation when Dash/local coverage is missing or stale:
CI Planning Workflow
- Inspect local validation commands.
- Inspect existing workflow files:
rg --files .github/workflows -g '*.yml' -g '*.yaml'
- Check SDK source:
global.json
- workflow
dotnet-version
- repository docs
- Decide job scope:
- restore
- build
- test
- format check
- pack check
- Decide matrix scope:
- one OS for library CI unless cross-platform behavior matters
- multiple OSes for filesystem, process, path, native dependency, or user-facing CLI differences
- Keep local and CI commands aligned.
Baseline Command Order
Prefer a simple shape:
dotnet restore
dotnet build --configuration Release --no-restore
dotnet test --configuration Release --no-build
Add package validation only for package surfaces:
dotnet pack --configuration Release --no-build
Add formatting verification only when the repo has .editorconfig and expects it:
dotnet format --verify-no-changes
F# And C# Notes
For F#:
- make sure CI builds the projects that prove
.fsproj ordering
- do not path-filter only
**.cs when F# files exist
For C#:
- keep nullable/analyzer failures visible
- respect warnings-as-errors behavior already used by the repo
For mixed solutions:
- include
**.fs, **.fsproj, **.cs, and **.csproj in path filters when filters are used
- run solution-level validation when project references cross language boundaries
Output Shape
Return:
CI scope: restore, build, test, format, pack.
SDK source: global.json, workflow version, or repo docs.
Matrix: OS and SDK versions.
Commands: local and CI command match.
Path filters: F#, C#, project, props, and workflow files.
Residual risk: what CI intentionally does not cover.
Guardrails
- Do not make CI publish packages unless the user asks for a release workflow.
- Do not filter out F# paths in a plugin that promises F# parity.
- Do not add large OS matrices without naming the cross-platform behavior they protect.
- Do not hide build warnings if the repo treats warnings as errors locally.
- Do not make CI commands differ from documented local validation without explaining why.
1---2name: ci-workflow-23description: Design and maintain .NET CI workflows for F#, C#, and mixed solutions with SDK setup, restore, build, test, format checks, package checks, caching, and matrix decisions.4license: Apache-2.05---67# .NET CI Workflow89## Purpose1011Make .NET CI prove the same behavior maintainers care about locally.1213The practical job is to choose SDK setup, restore/build/test commands, optional format/package checks, path filters, and matrix scope without making CI broader or noisier than the project needs.1415## When To Use1617- Use this skill when adding or changing CI for a .NET repository.18- Use this skill when local validation and CI disagree.19- Use this skill when adding F# or C# projects to an existing CI workflow.20- Use this skill before package or release workflows depend on CI results.2122## Source Check2324Use repo-local files, checked-out dependency sources, Dash MCP or Dash HTTP for installed docsets, and then official project documentation when Dash/local coverage is missing or stale:2526- [GitHub Actions and .NET](https://learn.microsoft.com/dotnet/devops/github-actions-overview)27- [Create a .NET test validation GitHub workflow](https://learn.microsoft.com/dotnet/devops/dotnet-test-github-action)28- [`actions/setup-dotnet`](https://github.com/actions/setup-dotnet)29- [`dotnet restore` documentation](https://learn.microsoft.com/dotnet/core/tools/dotnet-restore)30- [`dotnet build` documentation](https://learn.microsoft.com/dotnet/core/tools/dotnet-build)31- [`dotnet test` documentation](https://learn.microsoft.com/dotnet/core/tools/dotnet-test)3233## CI Planning Workflow34351. Inspect local validation commands.362. Inspect existing workflow files:37 ```bash38 rg --files .github/workflows -g '*.yml' -g '*.yaml'39 ```403. Check SDK source:41 - `global.json`42 - workflow `dotnet-version`43 - repository docs444. Decide job scope:45 - restore46 - build47 - test48 - format check49 - pack check505. Decide matrix scope:51 - one OS for library CI unless cross-platform behavior matters52 - multiple OSes for filesystem, process, path, native dependency, or user-facing CLI differences536. Keep local and CI commands aligned.5455## Baseline Command Order5657Prefer a simple shape:5859```bash60dotnet restore61dotnet build --configuration Release --no-restore62dotnet test --configuration Release --no-build63```6465Add package validation only for package surfaces:6667```bash68dotnet pack --configuration Release --no-build69```7071Add formatting verification only when the repo has `.editorconfig` and expects it:7273```bash74dotnet format --verify-no-changes75```7677## F# And C# Notes7879For F#:8081- make sure CI builds the projects that prove `.fsproj` ordering82- do not path-filter only `**.cs` when F# files exist8384For C#:8586- keep nullable/analyzer failures visible87- respect warnings-as-errors behavior already used by the repo8889For mixed solutions:9091- include `**.fs`, `**.fsproj`, `**.cs`, and `**.csproj` in path filters when filters are used92- run solution-level validation when project references cross language boundaries9394## Output Shape9596Return:97981. `CI scope`: restore, build, test, format, pack.992. `SDK source`: `global.json`, workflow version, or repo docs.1003. `Matrix`: OS and SDK versions.1014. `Commands`: local and CI command match.1025. `Path filters`: F#, C#, project, props, and workflow files.1036. `Residual risk`: what CI intentionally does not cover.104105## Guardrails106107- Do not make CI publish packages unless the user asks for a release workflow.108- Do not filter out F# paths in a plugin that promises F# parity.109- Do not add large OS matrices without naming the cross-platform behavior they protect.110- Do not hide build warnings if the repo treats warnings as errors locally.111- Do not make CI commands differ from documented local validation without explaining why.