Browse Source
* Add test project and necessary workflows to use it, with centralized versioning * Just test entire solution * Clean up something I copied from the monolithpull/152/head
10 changed files with 159 additions and 89 deletions
@ -0,0 +1,40 @@ |
|||||||
|
name: Test |
||||||
|
|
||||||
|
on: |
||||||
|
workflow_dispatch: |
||||||
|
push: |
||||||
|
branches: |
||||||
|
- "main" |
||||||
|
- "rc" |
||||||
|
- "hotfix-rc" |
||||||
|
pull_request: |
||||||
|
|
||||||
|
jobs: |
||||||
|
test: |
||||||
|
name: Run tests |
||||||
|
if: ${{ startsWith(github.head_ref, 'version_bump_') == false }} |
||||||
|
runs-on: ubuntu-22.04 |
||||||
|
|
||||||
|
steps: |
||||||
|
- name: Check out repo |
||||||
|
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
||||||
|
|
||||||
|
- name: Set up .NET |
||||||
|
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 |
||||||
|
|
||||||
|
- name: Test solution |
||||||
|
run: dotnet test --configuration Debug --logger "trx;LogFileName=test-results.trx" /p:CoverletOutputFormatter="cobertura" --collect:"XPlat Code Coverage" |
||||||
|
|
||||||
|
- name: Report test results |
||||||
|
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0 |
||||||
|
if: always() |
||||||
|
with: |
||||||
|
name: Test Results |
||||||
|
path: "**/test-results.trx" |
||||||
|
reporter: dotnet-trx |
||||||
|
fail-on-error: true |
||||||
|
|
||||||
|
- name: Upload to codecov.io |
||||||
|
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # v4.0.2 |
||||||
|
env: |
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
||||||
@ -0,0 +1,9 @@ |
|||||||
|
<Project> |
||||||
|
|
||||||
|
<PropertyGroup> |
||||||
|
<TargetFramework>net8.0</TargetFramework> |
||||||
|
|
||||||
|
<Version>2024.6.0</Version> |
||||||
|
</PropertyGroup> |
||||||
|
|
||||||
|
</Project> |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||||
|
|
||||||
|
<PropertyGroup> |
||||||
|
<IsPackable>false</IsPackable> |
||||||
|
<IsTestProject>true</IsTestProject> |
||||||
|
<RootNamespace>KeyConnector.Tests</RootNamespace> |
||||||
|
</PropertyGroup> |
||||||
|
|
||||||
|
<ItemGroup> |
||||||
|
<PackageReference Include="coverlet.collector" Version="6.0.2"> |
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
||||||
|
<PrivateAssets>all</PrivateAssets> |
||||||
|
</PackageReference> |
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" /> |
||||||
|
<PackageReference Include="xunit" Version="2.8.1" /> |
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1"> |
||||||
|
<PrivateAssets>all</PrivateAssets> |
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
||||||
|
</PackageReference> |
||||||
|
</ItemGroup> |
||||||
|
|
||||||
|
<ItemGroup> |
||||||
|
<ProjectReference Include="..\..\src\KeyConnector\KeyConnector.csproj" /> |
||||||
|
</ItemGroup> |
||||||
|
|
||||||
|
</Project> |
||||||
Loading…
Reference in new issue