azure-pipelines.rx.yml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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: add
  133. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  134. - task: DotNetCoreCLI@2
  135. displayName: Update Aliases
  136. inputs:
  137. command: custom
  138. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  139. custom: add
  140. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  141. - task: DotNetCoreCLI@2
  142. displayName: Update Testing
  143. inputs:
  144. command: custom
  145. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  146. custom: add
  147. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  148. - task: DotNetCoreCLI@2
  149. inputs:
  150. command: test
  151. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  152. arguments: -c $(BuildConfiguration) -f net5.0 --filter "SkipCI!=true"
  153. displayName: Run 5.0 Tests on Linux
  154. - task: DotNetCoreCLI@2
  155. inputs:
  156. command: test
  157. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  158. arguments: -c $(BuildConfiguration) -f netcoreapp3.1 --filter "SkipCI!=true"
  159. displayName: Run 3.1 Tests on Linux
  160. - task: DotNetCoreCLI@2
  161. inputs:
  162. command: test
  163. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  164. arguments: -c $(BuildConfiguration) -f netcoreapp2.1 --filter "SkipCI!=true"
  165. displayName: Run 2.1 Tests on Linux
  166. - job: WindowsDesktop
  167. pool:
  168. vmImage: windows-latest
  169. variables:
  170. BuildConfiguration: Release
  171. BuildPlatform: Any CPU
  172. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  173. steps:
  174. - task: UseDotNet@2
  175. inputs:
  176. version: 5.0.x
  177. includePreviewVersions: true
  178. performMultiLevelLookup: true
  179. - task: DotNetCoreCLI@2
  180. inputs:
  181. command: custom
  182. custom: tool
  183. arguments: install --tool-path . nbgv
  184. displayName: Install NBGV tool
  185. - script: nbgv cloud -a -p Rx.NET/Source
  186. displayName: Set Version
  187. - task: DownloadPipelineArtifact@2
  188. displayName: Download Build Artifacts
  189. inputs:
  190. artifactName: BuildPackages
  191. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  192. - task: DotNetCoreCLI@2
  193. displayName: Update Rx
  194. inputs:
  195. command: custom
  196. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  197. custom: add
  198. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  199. - task: DotNetCoreCLI@2
  200. displayName: Update Aliases
  201. inputs:
  202. command: custom
  203. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  204. custom: add
  205. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  206. - task: DotNetCoreCLI@2
  207. displayName: Update Testing
  208. inputs:
  209. command: custom
  210. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  211. custom: add
  212. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  213. - task: DotNetCoreCLI@2
  214. inputs:
  215. command: test
  216. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  217. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true"
  218. displayName: Run Tests on Window Desktop
  219. - stage: CodeSign
  220. condition: and(succeeded('IntegrationTests'), not(eq(variables['build.reason'], 'PullRequest')))
  221. jobs:
  222. - deployment: CodeSign
  223. displayName: Code Signing
  224. pool:
  225. vmImage: windows-latest
  226. environment: Code Sign
  227. variables:
  228. - group: SignClient Credentials
  229. strategy:
  230. runOnce:
  231. deploy:
  232. steps:
  233. - task: DotNetCoreCLI@2
  234. inputs:
  235. command: custom
  236. custom: tool
  237. arguments: install --tool-path . SignClient
  238. displayName: Install SignTool tool
  239. - pwsh: |
  240. .\SignClient "Sign" `
  241. --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
  242. --input "**/*.nupkg" `
  243. --config "$(Pipeline.Workspace)\config\signclient.json" `
  244. --user "$(SignClientUser)" `
  245. --secret "$(SignClientSecret)" `
  246. --name "Rx.NET" `
  247. --description "Rx.NET" `
  248. --descriptionUrl "https://github.com/dotnet/reactive"
  249. displayName: Sign packages
  250. - publish: $(Pipeline.Workspace)/BuildPackages
  251. displayName: Publish Signed Packages
  252. artifact: SignedPackages