Skip to content

Commit

Permalink
chore: Adding coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCraig committed Jan 29, 2024
1 parent 5b175ac commit d2642e8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/dotnet-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,20 @@ jobs:
run: dotnet build --no-restore --configuration $BUILD_CONFIG

- name: Test
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
run: dotnet test /p:CollectCoverage=true /p:CoverletOutput=TestResults-${{ matrix.dotnet-version }}/ /p:CoverletOutputFormat=lcov /p:Configuration=$BUILD_CONFIG --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
if: ${{ always() }}

- name: Publish coverage report to coveralls.io
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
path-to-lcov: TestResults-${{ matrix.dotnet-version }}/coverage.net8.0.info

- name: Upload NuGet package
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions FastActivator.Benchmarks/FastActivator.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 7 additions & 3 deletions FastActivator.PropertyTests/FastActivator.PropertyTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mecha.xUnit" Version="2.0.66" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mecha.xUnit" Version="2.1.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 6 additions & 2 deletions FastActivator.Tests/FastActivator.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
Expand All @@ -7,7 +7,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mecha.xUnit" Version="2.1.10" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mecha.xUnit" Version="2.1.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ The purpose of FastActivator is to replace the usage of `System.Activator` with

## Speed Comparisons

| Method | Mean | Error | StdDev | Ratio | Rank | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---------------------------- |----------:|---------:|---------:|------:|-----:|-------:|------:|------:|----------:|
| ActivatorCreateInstance | 509.96 ns | 7.513 ns | 6.660 ns | 1.00 | 2 | 0.0744 | - | - | 472 B |
| FastActivatorCreateInstance | 47.37 ns | 0.935 ns | 0.829 ns | 0.09 | 1 | 0.0153 | - | - | 96 B |
| Method | Mean | Error | StdDev | Rank | Gen0 | Allocated |
|---------------------------- |----------:|---------:|---------:|-----:|-------:|----------:|
| ActivatorCreateInstance | 182.80 ns | 1.272 ns | 1.127 ns | 2 | 0.0401 | 336 B |
| FastActivatorCreateInstance | 28.27 ns | 0.422 ns | 0.352 ns | 1 | 0.0115 | 96 B |

In many instances it's about 2x to 10x faster depending on the method used.

Expand Down
3 changes: 1 addition & 2 deletions docfx_project/articles/speed.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Speed Comparison with Activator
# ===============================
# Speed Comparison with Activator from Latest Build

[!INCLUDE [FastActivator.Benchmarks.Tests.FastVsActivator-report-github.md](../../FastActivator.Benchmarks/bin/Release/net8.0/BenchmarkDotNet.Artifacts/results/FastActivator.Benchmarks.Tests.FastVsActivator-report-github.md)]

0 comments on commit d2642e8

Please sign in to comment.