azure-pipelines.rx.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. trigger:
  2. branches:
  3. include:
  4. - main
  5. - rel/*
  6. paths:
  7. include:
  8. - Rx.NET/Source/*
  9. - .editorconfig
  10. - azure-pipelines.rx.yml
  11. pr:
  12. branches:
  13. include:
  14. - main
  15. - rel/*
  16. paths:
  17. include:
  18. - Rx.NET/Source/*
  19. - .editorconfig
  20. - azure-pipelines.rx.yml
  21. stages:
  22. - stage: Build
  23. jobs:
  24. - job: Build
  25. pool: vs2019-preview
  26. variables:
  27. BuildConfiguration: Release
  28. BuildPlatform: Any CPU
  29. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  30. steps:
  31. - task: UseDotNet@2
  32. displayName: Use .NET Core 5.0.x SDK
  33. inputs:
  34. version: 5.0.x
  35. includePreviewVersions: true
  36. performMultiLevelLookup: true
  37. - task: DotNetCoreCLI@2
  38. inputs:
  39. command: custom
  40. custom: tool
  41. arguments: install --tool-path . nbgv
  42. displayName: Install NBGV tool
  43. - script: nbgv cloud -a -p Rx.NET/Source
  44. displayName: Set Version
  45. - task: MSBuild@1
  46. displayName: Build System.Reactive.sln
  47. inputs:
  48. solution: Rx.NET/Source/System.Reactive.sln
  49. msbuildArguments: /restore /t:build /p:CreatePackage=true /p:NoPackageAnalysis=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts
  50. configuration: $(BuildConfiguration)
  51. maximumCpuCount: false
  52. - task: NuGetCommand@2
  53. displayName: Pack compatibility package
  54. inputs:
  55. command: custom
  56. arguments: pack Rx.NET/Source/facades/System.Reactive.Compatibility.nuspec -Version $(NBGV_NuGetPackageVersion) -MinClientVersion 2.12 -NoPackageAnalysis -outputdirectory $(Build.ArtifactStagingDirectory)\artifacts
  57. - task: DotNetCoreCLI@2
  58. inputs:
  59. command: custom
  60. custom: tool
  61. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  62. displayName: Install ReportGenerator tool
  63. - task: DotNetCoreCLI@2
  64. inputs:
  65. command: test
  66. projects: Rx.NET/Source/tests/Tests.System.Reactive/*.csproj
  67. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true" --settings Rx.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  68. displayName: Run Unit Tests
  69. - task: DotNetCoreCLI@2
  70. inputs:
  71. command: test
  72. projects: Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Tests.System.Reactive.ApiApprovals.csproj
  73. arguments: -c $(BuildConfiguration)
  74. displayName: Run Api Approvals Tests
  75. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  76. displayName: Create reports
  77. - task: PublishCodeCoverageResults@1
  78. displayName: 'Publish code coverage'
  79. inputs:
  80. codeCoverageTool: Cobertura
  81. summaryFileLocation: $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml
  82. - publish: Rx.NET/Source/build
  83. artifact: config
  84. displayName: Publish signing config
  85. - publish: $(Build.ArtifactStagingDirectory)\artifacts
  86. displayName: Publish artifacts
  87. artifact: BuildPackages
  88. - publish: Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api
  89. displayName: Publish test artifiacts
  90. artifact: ApprovalsTests
  91. condition: always()
  92. - stage: IntegrationTests
  93. jobs:
  94. - job: Linux
  95. pool:
  96. vmImage: ubuntu-latest
  97. variables:
  98. BuildConfiguration: Release
  99. BuildPlatform: Any CPU
  100. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  101. steps:
  102. - task: UseDotNet@2
  103. inputs:
  104. version: 5.0.x
  105. includePreviewVersions: true
  106. - task: UseDotNet@2
  107. inputs:
  108. version: '3.1.x'
  109. packageType: runtime
  110. - task: UseDotNet@2
  111. inputs:
  112. version: '2.2.x'
  113. packageType: runtime
  114. - task: DotNetCoreCLI@2
  115. inputs:
  116. command: custom
  117. custom: tool
  118. arguments: install --tool-path . nbgv
  119. displayName: Install NBGV tool
  120. - script: ./nbgv cloud -a -p Rx.NET/Source
  121. displayName: Set Version
  122. - task: DownloadPipelineArtifact@2
  123. displayName: Download Build Artifacts
  124. inputs:
  125. artifactName: BuildPackages
  126. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  127. - task: DotNetCoreCLI@2
  128. displayName: Update Rx
  129. inputs:
  130. command: custom
  131. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  132. custom: restore
  133. arguments: --configfile $(System.DefaultWorkingDirectory)/Rx.NET/Integration/NuGet.Config
  134. - task: DotNetCoreCLI@2
  135. inputs:
  136. command: test
  137. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  138. arguments: -c $(BuildConfiguration) -f net5.0 --filter "SkipCI!=true"
  139. displayName: Run 5.0 Tests on Linux
  140. - task: DotNetCoreCLI@2
  141. inputs:
  142. command: test
  143. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  144. arguments: -c $(BuildConfiguration) -f netcoreapp3.1 --filter "SkipCI!=true"
  145. displayName: Run 3.1 Tests on Linux
  146. - task: DotNetCoreCLI@2
  147. inputs:
  148. command: test
  149. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  150. arguments: -c $(BuildConfiguration) -f netcoreapp2.1 --filter "SkipCI!=true"
  151. displayName: Run 2.1 Tests on Linux
  152. - job: WindowsDesktop
  153. pool:
  154. vmImage: windows-latest
  155. variables:
  156. BuildConfiguration: Release
  157. BuildPlatform: Any CPU
  158. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  159. steps:
  160. - task: UseDotNet@2
  161. inputs:
  162. version: 5.0.x
  163. includePreviewVersions: true
  164. performMultiLevelLookup: true
  165. - task: DotNetCoreCLI@2
  166. inputs:
  167. command: custom
  168. custom: tool
  169. arguments: install --tool-path . nbgv
  170. displayName: Install NBGV tool
  171. - script: nbgv cloud -a -p Rx.NET/Source
  172. displayName: Set Version
  173. - task: DownloadPipelineArtifact@2
  174. displayName: Download Build Artifacts
  175. inputs:
  176. artifactName: BuildPackages
  177. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  178. - task: DotNetCoreCLI@2
  179. displayName: Update Rx
  180. inputs:
  181. command: custom
  182. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  183. custom: restore
  184. arguments: --configfile $(System.DefaultWorkingDirectory)/Rx.NET/Integration/NuGet.Config
  185. - task: DotNetCoreCLI@2
  186. inputs:
  187. command: test
  188. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  189. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true"
  190. displayName: Run Tests on Window Desktop
  191. - stage: CodeSign
  192. condition: and(succeeded('IntegrationTests'), not(eq(variables['build.reason'], 'PullRequest')))
  193. jobs:
  194. - deployment: CodeSign
  195. displayName: Code Signing
  196. pool:
  197. vmImage: windows-latest
  198. environment: Code Sign
  199. variables:
  200. - group: SignClient Credentials
  201. strategy:
  202. runOnce:
  203. deploy:
  204. steps:
  205. - task: DotNetCoreCLI@2
  206. inputs:
  207. command: custom
  208. custom: tool
  209. arguments: install --tool-path . SignClient
  210. displayName: Install SignTool tool
  211. - pwsh: |
  212. .\SignClient "Sign" `
  213. --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
  214. --input "**/*.nupkg" `
  215. --config "$(Pipeline.Workspace)\config\signclient.json" `
  216. --user "$(SignClientUser)" `
  217. --secret "$(SignClientSecret)" `
  218. --name "Rx.NET" `
  219. --description "Rx.NET" `
  220. --descriptionUrl "https://github.com/dotnet/reactive"
  221. displayName: Sign packages
  222. - publish: $(Pipeline.Workspace)/BuildPackages
  223. displayName: Publish Signed Packages
  224. artifact: SignedPackages