Skip to content

Commit

Permalink
codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Apr 1, 2021
1 parent 811f2a3 commit 7304b16
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 24 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ jobs:
- name: Build
run: dotnet build src --configuration Release --no-restore
- name: Test
run: dotnet test src --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
run: dotnet test --collect:"XPlat Code Coverage" --settings:src/DotNetStac.Test/coverlet.runsettings --results-directory:TestResults src
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
directory: TestResults
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
name: dotnet-results #-${{ matrix.dotnet-version }}
path: TestResults #-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
},
"problemMatcher": "$msCompile"
},
{
"label": "test with coverage",
"command": "dotnet",
"type": "shell",
"args": [
"test",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary",
"--collect:\"XPlat Code Coverage\"",
"--settings:src/DotNetStac.Test/coverlet.runsettings",
"--results-directory:TestResults",
"src/DotNetStac.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "pack",
"command": "dotnet",
Expand Down
14 changes: 7 additions & 7 deletions src/DotNetStac.Test/DotNetStac.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<CodeAnalysisRuleSet>$(SolutionDir)StyleCop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0"/>
<PackageReference Include="xunit" Version="2.4.0"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0"/>
<PackageReference Include="coverlet.collector" Version="1.0.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="GeoJSON.Net" Version="1.2.19"/>
<PackageReference Include="GeoJSON.Net" Version="1.2.19" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotNetStac\DotNetStac.csproj"/>
<ProjectReference Include="..\DotNetStac\DotNetStac.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\proj\SRID.csv">
Expand Down
File renamed without changes.
30 changes: 16 additions & 14 deletions src/DotNetStac/DotNetStac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@
<Copyright>Copyright (c) 2010-2020 by Terradue</Copyright>
<CodeAnalysisRuleSet>$(SolutionDir)StyleCop.ruleset</CodeAnalysisRuleSet>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="2.0.2"/>
<PackageReference Include="GeoJSON.Net" Version="1.2.19"/>
<PackageReference Include="TimePeriodLibrary.NET" Version="2.1.1"/>
<PackageReference Include="MathNet.Numerics" Version="4.12.0"/>
<PackageReference Include="ProjNet" Version="2.0.0"/>
<PackageReference Include="semver" Version="2.0.6"/>
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.14"/>
<PackageReference Include="System.Reflection" Version="4.3.0"/>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0"/>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All"/>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="2.0.2" />
<PackageReference Include="GeoJSON.Net" Version="1.2.19" />
<PackageReference Include="TimePeriodLibrary.NET" Version="2.1.1" />
<PackageReference Include="MathNet.Numerics" Version="4.12.0" />
<PackageReference Include="ProjNet" Version="2.0.0" />
<PackageReference Include="semver" Version="2.0.6" />
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.14" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="OpenCover" Version="4.7.922" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE" Pack="true" PackagePath=""/>
<None Include="..\..\docs\logo\stac_logo.png" Pack="true" PackagePath=""/>
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
<None Include="..\..\docs\logo\stac_logo.png" Pack="true" PackagePath="" />
<Content Include="..\proj\SRID.csv" copyToOutput="true">
<IncludeInPackage>true</IncludeInPackage>
<CopyToOutput>true</CopyToOutput>
Expand Down

0 comments on commit 7304b16

Please sign in to comment.