Skip to content

Commit

Permalink
test - add tests and modify CI configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco committed Nov 29, 2024
1 parent b655ec7 commit 2a0cfaf
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore

- name: Build solution
run: dotnet build -c Debug
run: dotnet build -c Release

- name: Run tests
run: dotnet test -c Debug --no-build --no-restore
run: dotnet test -c Release --no-build --no-restore
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/deep-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ jobs:
with:
dotnet-version: '9.0.x'

- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore

- name: Build and analyze
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
Expand Down
3 changes: 2 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mode: Mainline
workflow: GitHubFlow/v1
mode: ContinuousDeployment
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
assembly-informational-format: '{MajorMinorPatch}{PreReleaseTagWithDash}+{ShortSha}'
Expand Down
9 changes: 9 additions & 0 deletions HelloWorldRabbitMQ.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker", "Src\Worker\Worker
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkerAck", "Src\WorkerAck\WorkerAck.csproj", "{CBC5FD37-2E9A-4720-830F-95AE16A0EACD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmitLog.Tests", "Tests\EmitLog.Tests\EmitLog.Tests.csproj", "{9720CA0A-1A18-46A7-8C3D-88D9B92C2457}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -71,6 +75,10 @@ Global
{CBC5FD37-2E9A-4720-830F-95AE16A0EACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CBC5FD37-2E9A-4720-830F-95AE16A0EACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBC5FD37-2E9A-4720-830F-95AE16A0EACD}.Release|Any CPU.Build.0 = Release|Any CPU
{9720CA0A-1A18-46A7-8C3D-88D9B92C2457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9720CA0A-1A18-46A7-8C3D-88D9B92C2457}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9720CA0A-1A18-46A7-8C3D-88D9B92C2457}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9720CA0A-1A18-46A7-8C3D-88D9B92C2457}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -86,6 +94,7 @@ Global
{30DE4BFE-D057-4EB9-B225-337B02969C11} = {E961E0F4-9F78-44C0-B141-994178170F58}
{F9EF05D1-F808-43BA-8EE3-965E7C356336} = {E961E0F4-9F78-44C0-B141-994178170F58}
{CBC5FD37-2E9A-4720-830F-95AE16A0EACD} = {E961E0F4-9F78-44C0-B141-994178170F58}
{9720CA0A-1A18-46A7-8C3D-88D9B92C2457} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D23A7951-8498-4403-8293-0828B60021C0}
Expand Down
21 changes: 21 additions & 0 deletions Tests/EmitLog.Tests/EmitLog.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions Tests/EmitLog.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace EmitLog.Tests;

public class UnitTest1
{
[Fact]
public void Test1() { }

Check failure on line 6 in Tests/EmitLog.Tests/UnitTest1.cs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Tests/EmitLog.Tests/UnitTest1.cs#L6

Add a nested comment explaining why this method is empty, throw a 'NotSupportedException' or complete the implementation.
}

0 comments on commit 2a0cfaf

Please sign in to comment.