Skip to content

Commit

Permalink
Move coverlet options to csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Nov 17, 2022
1 parent a9f250d commit ae669b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<LangVersion>latest</LangVersion>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<CoverletOutput>../coverage.xml</CoverletOutput>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\XmlSampleGenerator\XmlSampleGenerator.csproj" />
Expand Down
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ test_script:
- ps: |
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /k:"mganss_XmlSchemaClassGenerator" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.net6.0.xml" /d:sonar.coverage.exclusions="**/Program.cs"
dotnet sonarscanner begin /k:"mganss_XmlSchemaClassGenerator" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs"
dotnet build
}
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\coverage.json" XmlSchemaClassGenerator.Tests\XmlSchemaClassGenerator.Tests.csproj /p:Include="[XmlSchemaClassGenerator]*" -f net6.0
- dotnet test /p:CollectCoverage=true XmlSchemaClassGenerator.Tests\XmlSchemaClassGenerator.Tests.csproj /p:Include="[XmlSchemaClassGenerator]*" -f net6.0
- ps: cp coverage.*.xml ./coverage.xml
- ps: |
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
dotnet sonarscanner end /d:sonar.login="$env:sonar_token"
}
- pip install codecov
- codecov -f "coverage.net6.0.json"
- codecov -f "coverage.xml"
artifacts:
- path: 'XmlSchemaClassGenerator\**\*.*nupkg'
- path: 'XmlSchemaClassGenerator.Console\**\*.*nupkg'
Expand Down

0 comments on commit ae669b0

Please sign in to comment.