azure-pipelines.rx.yml 9.0 KB

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