azure-pipelines.rx.yml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. jobs:
  22. - job: Build
  23. pool:
  24. vmImage: windows-2019
  25. variables:
  26. BuildConfiguration: Release
  27. BuildPlatform: Any CPU
  28. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  29. steps:
  30. - task: DotNetCoreInstaller@0
  31. inputs:
  32. version: '3.0.100-preview7-012588'
  33. - task: DotNetCoreCLI@2
  34. inputs:
  35. command: custom
  36. custom: tool
  37. arguments: install --tool-path . nbgv
  38. displayName: Install NBGV tool
  39. - script: nbgv cloud -a -p Rx.NET/Source
  40. displayName: Set Version
  41. - task: MSBuild@1
  42. displayName: Build System.Reactive.sln
  43. inputs:
  44. solution: Rx.NET/Source/System.Reactive.sln
  45. msbuildArguments: /restore /t:build /p:CreatePackage=true /p:NoPackageAnalysis=true /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\artifacts
  46. configuration: $(BuildConfiguration)
  47. maximumCpuCount: true
  48. - task: NuGetCommand@2
  49. displayName: Pack compatibility package
  50. inputs:
  51. command: custom
  52. arguments: pack Rx.NET/Source/facades/System.Reactive.Compatibility.nuspec -Version $(NBGV_NuGetPackageVersion) -MinClientVersion 2.12 -NoPackageAnalysis -outputdirectory $(Build.ArtifactStagingDirectory)\artifacts
  53. - task: DotNetCoreCLI@2
  54. inputs:
  55. command: custom
  56. custom: tool
  57. arguments: install --tool-path . dotnet-reportgenerator-globaltool
  58. displayName: Install ReportGenerator tool
  59. - task: DotNetCoreCLI@2
  60. inputs:
  61. command: test
  62. projects: Rx.NET/Source/tests/Tests.System.Reactive/*.csproj
  63. arguments: -c $(BuildConfiguration) --no-build --no-restore --filter "SkipCI!=true" --settings Rx.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
  64. displayName: Run Unit Tests
  65. - task: DotNetCoreCLI@2
  66. inputs:
  67. command: test
  68. projects: Rx.NET/Source/tests/Tests.System.Reactive.ApiApprovals/Tests.System.Reactive.ApiApprovals.csproj
  69. arguments: -c $(BuildConfiguration) --no-build --no-restore
  70. displayName: Run Api Approvals Tests
  71. - script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports -reporttypes:"Cobertura"
  72. displayName: Create reports
  73. - task: PublishCodeCoverageResults@1
  74. displayName: 'Publish code coverage'
  75. inputs:
  76. codeCoverageTool: Cobertura
  77. summaryFileLocation: $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml
  78. - task: DotNetCoreCLI@2
  79. inputs:
  80. command: custom
  81. custom: tool
  82. arguments: install --tool-path . Codecov.Tool
  83. displayName: Install Codecov tool
  84. condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
  85. - script: codecov -f $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml --flag rxnet
  86. env:
  87. CODECOV_TOKEN: $(CODECOV_TOKEN)
  88. displayName: Upload coverage to Codecov
  89. condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
  90. - task: PowerShell@2
  91. displayName: Authenticode Sign Packages
  92. inputs:
  93. filePath: Rx.NET/Source/build/Sign-Package.ps1
  94. env:
  95. SignClientUser: $(SignClientUser)
  96. SignClientSecret: $(SignClientSecret)
  97. ArtifactDirectory: $(Build.ArtifactStagingDirectory)\artifacts
  98. condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
  99. - task: PublishBuildArtifacts@1
  100. inputs:
  101. PathtoPublish: $(Build.ArtifactStagingDirectory)\artifacts
  102. ArtifactName: artifacts
  103. publishLocation: Container
  104. condition: always()
  105. - job: Integration_Linux_Tests
  106. dependsOn: Build
  107. pool:
  108. vmImage: ubuntu-16.04
  109. variables:
  110. BuildConfiguration: Release
  111. BuildPlatform: Any CPU
  112. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  113. steps:
  114. - task: DotNetCoreInstaller@0
  115. inputs:
  116. version: '3.0.100-preview7-012588'
  117. - task: DotNetCoreCLI@2
  118. inputs:
  119. command: custom
  120. custom: tool
  121. arguments: install --tool-path . nbgv
  122. displayName: Install NBGV tool
  123. - script: ./nbgv cloud -a -p Rx.NET/Source
  124. displayName: Set Version
  125. - task: DownloadBuildArtifacts@0
  126. displayName: 'Download Build Artifacts'
  127. inputs:
  128. artifactName: artifacts
  129. downloadPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  130. - script: mv $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages/artifacts/*.* $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  131. displayName: Move packages to LocalPackages directory
  132. - task: DotNetCoreCLI@2
  133. displayName: Update Rx
  134. inputs:
  135. command: custom
  136. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  137. custom: add
  138. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  139. - task: DotNetCoreCLI@2
  140. displayName: Update Aliases
  141. inputs:
  142. command: custom
  143. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  144. custom: add
  145. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  146. - task: DotNetCoreCLI@2
  147. displayName: Update Testing
  148. inputs:
  149. command: custom
  150. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  151. custom: add
  152. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  153. - task: DotNetCoreCLI@2
  154. inputs:
  155. command: test
  156. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  157. arguments: -c $(BuildConfiguration) -f netcoreapp3.0
  158. displayName: Run 3.0 Tests on Linux
  159. - task: DotNetCoreInstaller@0
  160. inputs:
  161. version: '2.2.104'
  162. - task: DotNetCoreCLI@2
  163. inputs:
  164. command: test
  165. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  166. arguments: -c $(BuildConfiguration) -f netcoreapp2.1 /p:TargetFrameworks=netcoreapp2.1
  167. displayName: Run 2.1 Tests on Linux
  168. - job: Integration_WindowsDesktop_Tests
  169. dependsOn: Build
  170. pool:
  171. vmImage: windows-2019
  172. variables:
  173. BuildConfiguration: Release
  174. BuildPlatform: Any CPU
  175. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  176. steps:
  177. - task: DotNetCoreInstaller@0
  178. inputs:
  179. version: '3.0.100-preview7-012588'
  180. - task: DotNetCoreCLI@2
  181. inputs:
  182. command: custom
  183. custom: tool
  184. arguments: install --tool-path . nbgv
  185. displayName: Install NBGV tool
  186. - script: nbgv cloud -a -p Rx.NET/Source
  187. displayName: Set Version
  188. - task: DownloadBuildArtifacts@0
  189. displayName: 'Download Build Artifacts'
  190. inputs:
  191. artifactName: artifacts
  192. downloadPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  193. - powershell: mv $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages/artifacts/*.* $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  194. displayName: Move packages to LocalPackages directory
  195. - task: DotNetCoreCLI@2
  196. displayName: Update Rx
  197. inputs:
  198. command: custom
  199. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  200. custom: add
  201. arguments: package System.Reactive -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  202. - task: DotNetCoreCLI@2
  203. displayName: Update Aliases
  204. inputs:
  205. command: custom
  206. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  207. custom: add
  208. arguments: package System.Reactive.Observable.Aliases -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  209. - task: DotNetCoreCLI@2
  210. displayName: Update Testing
  211. inputs:
  212. command: custom
  213. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  214. custom: add
  215. arguments: package Microsoft.Reactive.Testing -v $(NBGV_NuGetPackageVersion) -s $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  216. - task: DotNetCoreCLI@2
  217. inputs:
  218. command: test
  219. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  220. arguments: -c $(BuildConfiguration)
  221. displayName: Run 3.0 Tests on WindowDesktop