azure-pipelines.ix.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. trigger:
  2. branches:
  3. include:
  4. - master
  5. - rel/*
  6. paths:
  7. include:
  8. - Ix.NET/Source/*
  9. - .editorconfig
  10. - azure-pipelines.ix.yml
  11. pr:
  12. branches:
  13. include:
  14. - master
  15. - rel/*
  16. - IxAsyncCSharp8
  17. paths:
  18. include:
  19. - Ix.NET/Source/*
  20. - .editorconfig
  21. - azure-pipelines.ix.yml
  22. pool:
  23. vmImage: windows-2019
  24. variables:
  25. BuildConfiguration: Release
  26. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  27. steps:
  28. - task: DotNetCoreInstaller@0
  29. inputs:
  30. version: '3.0.100-preview7-012588'
  31. - task: DotNetCoreCLI@2
  32. inputs:
  33. command: custom
  34. custom: tool
  35. arguments: install --tool-path . nbgv
  36. displayName: Install NBGV tool
  37. - script: nbgv cloud -p Ix.NET\Source
  38. displayName: Set Version
  39. - task: DotNetCoreCLI@2
  40. inputs:
  41. command: restore
  42. feedsToUse: config
  43. nugetConfigPath: Ix.NET/Source/NuGet.config
  44. projects: Ix.NET/Source/**/*.csproj
  45. displayName: Restore
  46. - task: DotNetCoreCLI@2
  47. inputs:
  48. command: pack
  49. packagesToPack: Ix.NET/Source/**/System.Interactive*.csproj;Ix.NET/Source/**/System.Linq.*.csproj;!Ix.NET/Source/**/*.Tests*.csproj;!Ix.NET/Source/refs/**
  50. configuration: $(BuildConfiguration)
  51. packDirectory: $(Build.ArtifactStagingDirectory)\artifacts
  52. verbosityPack: Minimal
  53. displayName: Pack
  54. - task: DotNetCoreCLI@2
  55. inputs:
  56. command: custom
  57. custom: tool
  58. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  59. displayName: Install ReportGenerator tool
  60. - task: DotNetCoreCLI@2
  61. inputs:
  62. command: test
  63. projects: Ix.NET/Source/**/*.Tests.csproj
  64. arguments: -c $(BuildConfiguration) --settings Ix.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  65. displayName: Run Tests
  66. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  67. displayName: Create reports
  68. - task: PublishCodeCoverageResults@1
  69. displayName: 'Publish code coverage'
  70. inputs:
  71. codeCoverageTool: Cobertura
  72. summaryFileLocation: $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml
  73. - task: DotNetCoreCLI@2
  74. inputs:
  75. command: custom
  76. custom: tool
  77. arguments: install --tool-path . Codecov.Tool
  78. displayName: Install Codecov tool
  79. condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
  80. - script: codecov -f $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml --flag ixnet
  81. env:
  82. CODECOV_TOKEN: $(CODECOV_TOKEN)
  83. displayName: Upload coverage to Codecov
  84. condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
  85. - task: PowerShell@2
  86. displayName: Authenticode Sign Packages
  87. inputs:
  88. filePath: Ix.NET/Source/build/Sign-Package.ps1
  89. env:
  90. SignClientUser: $(SignClientUser)
  91. SignClientSecret: $(SignClientSecret)
  92. ArtifactDirectory: $(Build.ArtifactStagingDirectory)\artifacts
  93. condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
  94. - task: PublishPipelineArtifact@0
  95. displayName: Publish packages
  96. inputs:
  97. targetPath: $(Build.ArtifactStagingDirectory)\artifacts
  98. artifactName: artifacts
  99. - task: PublishPipelineArtifact@0
  100. displayName: Publish Code Coverage XML
  101. inputs:
  102. artifactName: Coverage Report XML
  103. targetPath: $(Build.SourcesDirectory)/Ix.NET/Source/coverlet/reports/Cobertura.xml