azure-pipelines.rx.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. trigger:
  2. branches:
  3. include:
  4. - master
  5. - rel/*
  6. paths:
  7. include:
  8. - Rx.NET/Source/*
  9. - .editorconfig
  10. - azure-pipelines.rx.yml
  11. pr:
  12. branches:
  13. include:
  14. - master
  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:
  26. vmImage: windows-2019
  27. variables:
  28. BuildConfiguration: Release
  29. BuildPlatform: Any CPU
  30. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  31. steps:
  32. - task: UseDotNet@2
  33. displayName: Use .NET Core 3.1.x SDK
  34. inputs:
  35. version: 3.1.x
  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: MSBuild@1
  64. displayName: Build System.Reactive.sln
  65. inputs:
  66. solution: Rx.NET/Source/System.Reactive.sln
  67. msbuildArguments: /t:rebuild /p:ContinuousIntegrationBuild=false
  68. configuration: $(BuildConfiguration)
  69. maximumCpuCount: false
  70. - task: DotNetCoreCLI@2
  71. inputs:
  72. command: test
  73. projects: Rx.NET/Source/tests/Tests.System.Reactive/*.csproj
  74. arguments: -c $(BuildConfiguration) --no-build --no-restore --filter "SkipCI!=true" --settings Rx.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  75. displayName: Run Unit Tests
  76. - task: DotNetCoreCLI@2
  77. inputs:
  78. command: test
  79. projects: Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Tests.System.Reactive.ApiApprovals.csproj
  80. arguments: -c $(BuildConfiguration) --no-build --no-restore
  81. displayName: Run Api Approvals Tests
  82. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  83. displayName: Create reports
  84. - task: PublishCodeCoverageResults@1
  85. displayName: 'Publish code coverage'
  86. inputs:
  87. codeCoverageTool: Cobertura
  88. summaryFileLocation: $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml
  89. - publish: Rx.NET/Source/build
  90. artifact: config
  91. displayName: Publish signing config
  92. - publish: $(Build.ArtifactStagingDirectory)\artifacts
  93. displayName: Publish artifacts
  94. artifact: BuildPackages
  95. - publish: Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Api
  96. displayName: Publish test artifiacts
  97. artifact: ApprovalsTests
  98. condition: always()
  99. - job: Integration_Linux_Tests
  100. dependsOn: Build
  101. pool:
  102. vmImage: ubuntu-16.04
  103. variables:
  104. BuildConfiguration: Release
  105. BuildPlatform: Any CPU
  106. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  107. steps:
  108. - task: UseDotNet@2
  109. inputs:
  110. version: '3.0.x'
  111. - task: UseDotNet@2
  112. inputs:
  113. version: '2.2.x'
  114. packageType: runtime
  115. - task: DotNetCoreCLI@2
  116. inputs:
  117. command: custom
  118. custom: tool
  119. arguments: install --tool-path . nbgv
  120. displayName: Install NBGV tool
  121. - script: ./nbgv cloud -a -p Rx.NET/Source
  122. displayName: Set Version
  123. - task: DownloadPipelineArtifact@2
  124. displayName: Download Build Artifacts
  125. inputs:
  126. artifactName: BuildPackages
  127. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  128. - task: DotNetCoreCLI@2
  129. displayName: Update Rx
  130. inputs:
  131. command: custom
  132. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  133. custom: add
  134. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  135. - task: DotNetCoreCLI@2
  136. displayName: Update Aliases
  137. inputs:
  138. command: custom
  139. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  140. custom: add
  141. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  142. - task: DotNetCoreCLI@2
  143. displayName: Update Testing
  144. inputs:
  145. command: custom
  146. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  147. custom: add
  148. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  149. - task: DotNetCoreCLI@2
  150. inputs:
  151. command: test
  152. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  153. arguments: -c $(BuildConfiguration) -f netcoreapp3.0
  154. displayName: Run 3.0 Tests on Linux
  155. - task: DotNetCoreCLI@2
  156. inputs:
  157. command: test
  158. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  159. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true" -f netcoreapp2.1 /p:TargetFrameworks=netcoreapp2.1
  160. displayName: Run 2.1 Tests on Linux
  161. - job: Integration_WindowsDesktop_Tests
  162. dependsOn: Build
  163. pool:
  164. vmImage: windows-2019
  165. variables:
  166. BuildConfiguration: Release
  167. BuildPlatform: Any CPU
  168. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  169. steps:
  170. - task: UseDotNet@2
  171. inputs:
  172. version: '3.0.x'
  173. performMultiLevelLookup: true
  174. - task: DotNetCoreCLI@2
  175. inputs:
  176. command: custom
  177. custom: tool
  178. arguments: install --tool-path . nbgv
  179. displayName: Install NBGV tool
  180. - script: nbgv cloud -a -p Rx.NET/Source
  181. displayName: Set Version
  182. - task: DownloadPipelineArtifact@2
  183. displayName: Download Build Artifacts
  184. inputs:
  185. artifactName: BuildPackages
  186. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  187. - task: DotNetCoreCLI@2
  188. displayName: Update Rx
  189. inputs:
  190. command: custom
  191. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  192. custom: add
  193. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  194. - task: DotNetCoreCLI@2
  195. displayName: Update Aliases
  196. inputs:
  197. command: custom
  198. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  199. custom: add
  200. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  201. - task: DotNetCoreCLI@2
  202. displayName: Update Testing
  203. inputs:
  204. command: custom
  205. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  206. custom: add
  207. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  208. - task: DotNetCoreCLI@2
  209. inputs:
  210. command: test
  211. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  212. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true"
  213. displayName: Run 3.0 Tests on WindowDesktop
  214. - stage: CodeSign
  215. condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
  216. jobs:
  217. - deployment: CodeSign
  218. displayName: Code Signing
  219. pool:
  220. vmImage: windows-latest
  221. environment: Code Sign
  222. variables:
  223. - group: SignClient Credentials
  224. strategy:
  225. runOnce:
  226. deploy:
  227. steps:
  228. - task: DotNetCoreCLI@2
  229. inputs:
  230. command: custom
  231. custom: tool
  232. arguments: install --tool-path . SignClient
  233. displayName: Install SignTool tool
  234. - pwsh: |
  235. .\SignClient "Sign" `
  236. --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
  237. --input "**/*.nupkg" `
  238. --config "$(Pipeline.Workspace)\config\signclient.json" `
  239. --user "$(SignClientUser)" `
  240. --secret "$(SignClientSecret)" `
  241. --name "Rx.NET" `
  242. --description "Rx.NET" `
  243. --descriptionUrl "https://github.com/dotnet/reactive"
  244. displayName: Sign packages
  245. - publish: $(Pipeline.Workspace)/BuildPackages
  246. displayName: Publish Signed Packages
  247. artifact: SignedPackages