Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,19 @@ jobs:
- name: 'Build CommunityToolkit.Maui'
run: dotnet build ${{ env.PathToLibrarySolution }} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }}

- name: Run All Unit Tests
run: dotnet test -c Release ${{ env.PathToLibrarySolution }} --settings ".runsettings" --collect "XPlat code coverage" --logger trx --results-directory ${{ runner.temp }} --logger GitHubActions
- name: Run CommunityToolkit Analyzers UnitTests
run: dotnet run -c Release ${{ env.PathToCommunityToolkitAnalyzersUnitTestCsproj }} --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-analyzers.cobertura.xml" --coverage-output-format cobertura --report-xunit

- name: Run CommunityToolkit UnitTests
run: dotnet run -c Release ${{ env.PathToCommunityToolkitUnitTestCsproj }} --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut.cobertura.xml" --coverage-output-format cobertura --report-xunit

- name: Publish Test Results
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: Test Results
path: |
${{ runner.temp }}/**/*.trx
${{ runner.temp }}

- name: Pack CommunityToolkit.Maui.Core NuGet
run: dotnet pack -c Release ${{ env.PathToCommunityToolkitCoreCsproj }} -p:PackageVersion=${{ env.NugetPackageVersion }}
Expand Down
1 change: 1 addition & 0 deletions samples/CommunityToolkit.Maui.Sample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\.editorconfig = ..\.editorconfig
..\Directory.Build.props = ..\Directory.Build.props
..\Directory.Build.targets = ..\Directory.Build.targets
..\.github\workflows\dotnet-build.yml = ..\.github\workflows\dotnet-build.yml
..\global.json = ..\global.json
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@

<PropertyGroup>
<TargetFramework>$(NetVersion)</TargetFramework>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GF</CompilerGeneratedFilesOutputPath>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

<OutputType>Exe</OutputType>
<RootNamespace>CommunityToolkit.Maui.Analyzers.UnitTests</RootNamespace>

<TestingPlatformDotnetTestSupport>false</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.0.1" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.34.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" PrivateAssets="All" />
<PackageReference Include="coverlet.collector" Version="6.0.4" PrivateAssets="All" />
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
<PackageReference Include="xunit.v3" Version="1.0.1" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<!--Fix vulnerabilities-->
<PackageReference Include="System.Formats.Asn1" Version="9.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetVersion)</TargetFramework>
<OutputType>exe</OutputType>
<IsPackable>false</IsPackable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GF</CompilerGeneratedFilesOutputPath>

<OutputType>Exe</OutputType>
<RootNamespace>CommunityToolkit.Maui.UnitTests</RootNamespace>

<TestingPlatformDotnetTestSupport>false</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.0.1" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.34.1" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" PrivateAssets="All" />
<PackageReference Include="coverlet.collector" Version="6.0.4" PrivateAssets="All" />
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)"/>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/CommunityToolkit.Maui.UnitTests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Xunit;

[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = false)]
3 changes: 1 addition & 2 deletions src/CommunityToolkit.Maui.UnitTests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"parallelizeAssembly": false,
"parallelizeTestCollections": false
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}