<p>You do not need to include anything into your assembly to run your tests using GitHub Actions. Just create workflow file in .github/workflows folder with the following content (assuming that you have .NET Core project):</p>

<pre class="lang-yaml prettyprint-override"><code>---
name: Tests

on: push

jobs:
  tests:
    name: Unit Testing
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2.1.0
      - run: dotnet test
</code></pre>

<blockquote>
  <p>dotnet is pre-installed on windows machine but is not pre-installed on macos and ubuntu. So, you have to install dotnet by adding an extra step in case you want to run it on one of these machines. You can use <a href="https://github.com/marketplace/actions/setup-net-core-sdk" rel="nofollow noreferrer">actions/setup-dotnet</a> action for this purpose.</p>
</blockquote>

CC BY-SA 4.0
2020-06-11T17:36:10.357Z
2020-06-11T17:36:10.357Z
Leonid
<p>Could You help me? I use <strong>NUnit</strong> framework to test my .NET project. And I want to run my tests via <strong>GitHub Actions</strong>. </p>

<p>What should be included in the assembly of my project? Maybe there are some standard examples?</p>

<github><nuget><unit-testing>
How to create GitHub Actions for unit testing in .NET projects?
Leonid
# How to create GitHub Actions for unit testing in .NET projects?

(Asked by: username_0 on 2020-01-14)

Could You help me? I use **NUnit** framework to test my .NET project. And I want to run my tests via **GitHub Actions**.

What should be included in the assembly of my project? Maybe there are some standard examples?

**Tags:** github, nuget, unit-testing


---

## 1 answers

### Answer by username_0 on 2020-06-11. Score: 3 | Accepted answer

You do not need to include anything into your assembly to run your tests using GitHub Actions. Just create workflow file in .github/workflows folder with the following content (assuming that you have .NET Core project):
---
name: Tests

on: push

jobs:
  tests:
    name: Unit Testing
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2.1.0
      - run: dotnet test


dotnet is pre-installed on windows machine but is not pre-installed on macos and ubuntu. So, you have to install dotnet by adding an extra step in case you want to run it on one of these machines. You can use actions/setup-dotnet action for this purpose.


---

