Skip to content

codebeltnet/dotnet-test

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Test from Codebelt

Uses the .NET CLI dotnet test command that utilizes the test runner in the .NET SDK.

To have the best experience, it is recommended to use the reusable workflow jobs-dotnet-test that also provides additional features such as caching, test result publishing, and more.

Supports projects input we learned to appreciate from AzDO DotNetCoreCLI.

This action is part of the Codebelt umbrella and ensures a consistent way of:

  • Defining your CI/CD pipeline
  • Structuring your repository
  • Keeping your codebase small and feasible
  • Writing clean and maintainable code
  • Deploying your code to different environments
  • Automating as much as possible

A paved path to excel as a DevSecOps Engineer.

Usage

To use this action in your GitHub repository, you can follow these steps:

uses: codebeltnet/dotnet-test@v4

Inputs

with:
  # Optional path to the project(s) file to test. Pass empty to test whole solution.
  # Supports globbing.
  projects: ''
  # Defines the build configuration.
  configuration: 'Release'
  # Sets the verbosity level of the command.
  # Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. 
  # The default is quiet.
  verbosity-level: 'quiet'
  # The name of the folder where the test results will be written.
  test-results-folder-name: 'TestResults'
  # Provides a way to fully customize the build. See https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022#switches for more information.
  build-switches: ''
  # The time to wait for a test to complete before collecting a dump.
  blame-hang-timeout: '10m'
  # The type of dump to collect when a test hangs.
  blame-hang-dump-type: 'mini'
  # Whether to build the project(s) before testing. Default is false.
  build: 'false'
  # Whether to restore the project(s) before testing. Default is false.
  restore: 'false'
  # Additional arguments to pass to the test runner. Default is empty.
  test-arguments: ''

Outputs

This action has no outputs.

Examples

Test all projects in the test folder

- name: Test with Release build
  uses: codebeltnet/dotnet-test@v4
  with:
    configuration: Release

Caller workflows to showcase the Codebelt experience

Basic CI/CD Pipeline

Intermediate CI/CD Pipeline

Advanced CI/CD Pipeline

Contributing to .NET Test from Codebelt

Contributions are welcome! Feel free to submit issues, feature requests, or pull requests to help improve this action.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Tip

To learn more about the Codebelt experience and offerings, visit our organization page on GitHub.

About

An opinionated GitHub Action for unit testing projects as part of your CI flow.

Resources

License

Stars

Watchers

Forks

Packages

No packages published