azure-pipelines.rx.yml 9.3 KB

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