mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-06-28 13:58:32 +08:00
use azure pipelines instead of appveyor for builds
* trial azure pipelines [skip ci] * use vs2017 * build pr commits * include codecov and update test nuget * add codecov call * add publish test results step * include coverlet package for test coverage and allow coverlet dynamic public types * add azure pipelines badge and remove appveyor badge * add nuget pack step * use build configuration variable for nuget pack and move after build * fix path to package to pack * change nuget to dotnet pack * remove old codecov related tools
This commit is contained in:
parent
3c49371c68
commit
283e1d38fa
@ -2,7 +2,7 @@
|
||||
|
||||
# PdfPig #
|
||||
|
||||
[](https://ci.appveyor.com/project/EliotJones/pdf)
|
||||
[](https://dev.azure.com/pdfpig/pdfpig/_build/latest?definitionId=1&branchName=master)
|
||||
[](https://codecov.io/gh/UglyToad/PdfPig)
|
||||
[](https://gitter.im/pdfpig/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
|
56
azure-pipelines.yml
Normal file
56
azure-pipelines.yml
Normal file
@ -0,0 +1,56 @@
|
||||
# .NET Desktop
|
||||
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
|
||||
# Add steps that publish symbols, save build artifacts, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
|
||||
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pr:
|
||||
- master
|
||||
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
|
||||
variables:
|
||||
solution: '**/*.sln'
|
||||
buildPlatform: 'Any CPU'
|
||||
buildConfiguration: 'Release'
|
||||
|
||||
steps:
|
||||
- task: NuGetToolInstaller@1
|
||||
|
||||
- task: NuGetCommand@2
|
||||
inputs:
|
||||
restoreSolution: '$(solution)'
|
||||
|
||||
- task: VSBuild@1
|
||||
inputs:
|
||||
solution: '$(solution)'
|
||||
platform: '$(buildPlatform)'
|
||||
configuration: '$(buildConfiguration)'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: 'pack'
|
||||
packagesToPack: '**/UglyToad.PdfPig.csproj'
|
||||
includesymbols: true
|
||||
versioningScheme: 'off'
|
||||
|
||||
- script: |
|
||||
dotnet test ./src/UglyToad.PdfPig.Tests/UglyToad.PdfPig.Tests.csproj -c Debug --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
|
||||
cd ./src/UglyToad.PdfPig.Tests
|
||||
dir
|
||||
displayName: 'Build source, tests and run tests with coverage'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFormat: 'VSTest'
|
||||
testResultsFiles: '**/*.trx'
|
||||
failTaskOnFailedTests: true
|
||||
testRunTitle: 'Gather test results'
|
||||
|
||||
# Upload coverage to codecov.io
|
||||
- script: |
|
||||
%USERPROFILE%\.nuget\packages\codecov\1.5.0\tools\codecov.exe -f "./src/UglyToad.PdfPig.Tests/coverage.opencover.xml" -t $(codecov)
|
||||
displayName: Upload coverage to codecov.io
|
@ -1,9 +0,0 @@
|
||||
@echo off
|
||||
|
||||
cd src\CodeCoverage
|
||||
|
||||
nuget restore packages.config -PackagesDirectory .
|
||||
|
||||
cd ..
|
||||
|
||||
CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test UglyToad.PdfPig.Tests\UglyToad.PdfPig.Tests.csproj --framework netcoreapp2.0 -c debug" -register:user -output:.\test-results.xml -hideskipped:All -returntargetcode -oldStyle -filter:"+[UglyToad.PdfPig*]* -[UglyToad.PdfPig.Tests*]*"
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="OpenCover" version="4.6.519" />
|
||||
</packages>
|
@ -1,5 +1,6 @@
|
||||
namespace UglyToad.PdfPig.Tests
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@ -19,6 +20,12 @@
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
// Skip coverage measuring instrumentation classes.
|
||||
if (type.FullName.StartsWith("Coverlet", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (type.IsPublic)
|
||||
{
|
||||
publicTypeNames.Add(type.FullName);
|
||||
|
@ -81,7 +81,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="Codecov" Version="1.5.0" />
|
||||
<PackageReference Include="coverlet.msbuild" Version="2.6.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="4.5.0-preview2-26406-04" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
|
||||
|
Binary file not shown.
@ -1,7 +0,0 @@
|
||||
src\CodeCoverage\CodeCoverage.cmd
|
||||
|
||||
pwd
|
||||
|
||||
Expand-Archive tools\Codecov.zip -DestinationPath "tools"
|
||||
|
||||
tools\Codecov\codecov.exe -f "src\test-results.xml"
|
Loading…
Reference in New Issue
Block a user