Skip to content

Commit

Permalink
Merge branch 'main' into qr-code
Browse files Browse the repository at this point in the history
  • Loading branch information
biancaisc authored Feb 2, 2025
2 parents 0a223aa + 6013492 commit 17d213a
Show file tree
Hide file tree
Showing 40 changed files with 1,904 additions and 62 deletions.
44 changes: 38 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

# This workflow will build and test a .NET project
name: .NET

on:
Expand All @@ -27,12 +25,46 @@ jobs:
with:
dotnet-version: 8.0.x

- name: Restore dependencies
- name: Restore Backend Dependencies
run: dotnet restore CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj

- name: Build
- name: Build Backend
run: dotnet build CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj --no-restore

- name: Test
- name: Run Backend Tests
run: dotnet test CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj --no-build --verbosity normal

- name: Clean Test Project
run: dotnet clean CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj

- name: Restore Test Dependencies
run: dotnet restore CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj

- name: Build Test Project
run: dotnet build CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj --no-restore

- name: Run Unit and Integration Tests
run: dotnet test CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj --no-build --verbosity detailed --logger "trx;LogFileName=TestResults.trx"

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults.trx

performance-tests:
name: Run Performance Tests
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install k6
run: |
sudo apt update
sudo snap install k6
- name: Run k6 Performance Tests
run: k6 run CollectifyAPI/CollectifyAPI.Tests/PerformanceTests/test.js
44 changes: 44 additions & 0 deletions CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputPath>bin\Debug\net8.0\</OutputPath>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.12" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CollectifyAPI\CollectifyAPI.csproj" />
</ItemGroup>

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

<ItemGroup>
<None Update="testhost.deps.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit 17d213a

Please sign in to comment.