Skip to content

Create NuGet template package for test framework#2

Merged
fszymaniak merged 2 commits intomainfrom
claude/nuget-test-framework-template-01BMekR9gqRSbj8t1QErrYiv
Nov 18, 2025
Merged

Create NuGet template package for test framework#2
fszymaniak merged 2 commits intomainfrom
claude/nuget-test-framework-template-01BMekR9gqRSbj8t1QErrYiv

Conversation

@fszymaniak
Copy link
Copy Markdown
Owner

Major Changes:

  • Create .template.config with template.json and CLI parameter mappings
  • Add NuGet package specification (.nuspec) for template distribution
  • Upgrade from .NET 7.0 to .NET 8.0 LTS
  • Update all NuGet packages to latest stable versions
  • Create interactive PowerShell setup script (setup.ps1)
  • Enhance GitHub Actions workflow with multi-OS testing, coverage, and security scanning
  • Add comprehensive documentation (TEMPLATE_USAGE.md, CHANGES.md)

Template Features:

  • Customizable via CLI parameters (test type, framework, test runner, etc.)
  • Conditional file inclusion (WireMock, examples, CI/CD)
  • Support for .NET 8.0 and 9.0
  • Multiple test runners: NUnit, xUnit, MSTest
  • Interactive and non-interactive setup modes

Package Updates:

  • Autofac.Extensions.DependencyInjection: 9.0.0 → 10.0.0
  • Microsoft.NET.Test.Sdk: 17.7.1 → 17.11.1
  • NUnit3TestAdapter: 4.5.0 → 4.6.0
  • RestSharp: 110.2.1-alpha → 112.1.0 (stable)
  • WireMock.Net: 1.5.49 → 1.6.8
  • coverlet.collector: 3.2.0 → 6.0.2
  • Added NUnit: 4.2.2

CI/CD Improvements:

  • Multi-platform testing (Ubuntu, Windows, macOS)
  • Code coverage collection and reporting
  • Living documentation generation
  • Security vulnerability scanning
  • Automatic template packaging on main branch
  • Test results and artifacts upload

Documentation:

  • Template usage guide with installation/publishing instructions
  • Comprehensive README template for generated projects
  • Change log with migration details
  • Interactive setup script with validation

Users can now install with:
dotnet new install TestFrameworkBoilerplate.Template

And create projects with:
dotnet new testfw -n MyProject [options]

Or use interactive mode:
pwsh setup.ps1

Major Changes:
- Create .template.config with template.json and CLI parameter mappings
- Add NuGet package specification (.nuspec) for template distribution
- Upgrade from .NET 7.0 to .NET 8.0 LTS
- Update all NuGet packages to latest stable versions
- Create interactive PowerShell setup script (setup.ps1)
- Enhance GitHub Actions workflow with multi-OS testing, coverage, and security scanning
- Add comprehensive documentation (TEMPLATE_USAGE.md, CHANGES.md)

Template Features:
- Customizable via CLI parameters (test type, framework, test runner, etc.)
- Conditional file inclusion (WireMock, examples, CI/CD)
- Support for .NET 8.0 and 9.0
- Multiple test runners: NUnit, xUnit, MSTest
- Interactive and non-interactive setup modes

Package Updates:
- Autofac.Extensions.DependencyInjection: 9.0.0 → 10.0.0
- Microsoft.NET.Test.Sdk: 17.7.1 → 17.11.1
- NUnit3TestAdapter: 4.5.0 → 4.6.0
- RestSharp: 110.2.1-alpha → 112.1.0 (stable)
- WireMock.Net: 1.5.49 → 1.6.8
- coverlet.collector: 3.2.0 → 6.0.2
- Added NUnit: 4.2.2

CI/CD Improvements:
- Multi-platform testing (Ubuntu, Windows, macOS)
- Code coverage collection and reporting
- Living documentation generation
- Security vulnerability scanning
- Automatic template packaging on main branch
- Test results and artifacts upload

Documentation:
- Template usage guide with installation/publishing instructions
- Comprehensive README template for generated projects
- Change log with migration details
- Interactive setup script with validation

Users can now install with:
  dotnet new install TestFrameworkBoilerplate.Template

And create projects with:
  dotnet new testfw -n MyProject [options]

Or use interactive mode:
  pwsh setup.ps1
Fixes:
1. Add workflow-level permissions for checks and pull requests
   - Resolves "Resource not accessible by integration" error
   - Allows test-reporter action to create check runs

2. Make test reporter non-blocking
   - Add continue-on-error to prevent workflow failure
   - Useful for fork PRs where permissions may be limited

3. Fix template packaging step
   - Replace dotnet pack with nuget pack
   - Use .nuspec file for proper template packaging
   - Auto-increment version with GitHub run number (1.0.X)
   - Add nuget/setup-nuget action for NuGet CLI

Permissions added:
- contents: read (for checkout)
- checks: write (for test reports)
- pull-requests: write (for PR comments)

These changes ensure the CI/CD pipeline runs successfully and properly
packages the template as a NuGet package.
@fszymaniak fszymaniak merged commit d7f0fd3 into main Nov 18, 2025
7 checks passed
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