azure-pipelines.rx.yml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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:
  26. vmImage: windows-latest
  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 7.0.x SDK
  34. inputs:
  35. version: 7.0.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: 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: 7.0.x
  105. - task: UseDotNet@2
  106. inputs:
  107. version: '6.0.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: restore
  128. arguments: --configfile $(System.DefaultWorkingDirectory)/Rx.NET/Integration/NuGet.Config
  129. - task: DotNetCoreCLI@2
  130. inputs:
  131. command: test
  132. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  133. arguments: -c $(BuildConfiguration) -f net7.0 --filter "SkipCI!=true"
  134. displayName: Run 7.0 Tests on Linux
  135. - task: DotNetCoreCLI@2
  136. inputs:
  137. command: test
  138. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LinuxTests/LinuxTests.csproj
  139. arguments: -c $(BuildConfiguration) -f net6.0 --filter "SkipCI!=true"
  140. displayName: Run 6.0 Tests on Linux
  141. - job: WindowsDesktop
  142. pool:
  143. vmImage: windows-latest
  144. variables:
  145. BuildConfiguration: Release
  146. BuildPlatform: Any CPU
  147. DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  148. steps:
  149. - task: UseDotNet@2
  150. inputs:
  151. version: 7.0.x
  152. performMultiLevelLookup: true
  153. - task: DotNetCoreCLI@2
  154. inputs:
  155. command: custom
  156. custom: tool
  157. arguments: install --tool-path . nbgv
  158. displayName: Install NBGV tool
  159. - script: nbgv cloud -a -p Rx.NET/Source
  160. displayName: Set Version
  161. - task: DownloadPipelineArtifact@2
  162. displayName: Download Build Artifacts
  163. inputs:
  164. artifactName: BuildPackages
  165. targetPath: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/LocalPackages
  166. - task: DotNetCoreCLI@2
  167. displayName: Update Rx
  168. inputs:
  169. command: custom
  170. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  171. custom: restore
  172. arguments: --configfile $(System.DefaultWorkingDirectory)/Rx.NET/Integration/NuGet.Config
  173. - task: DotNetCoreCLI@2
  174. inputs:
  175. command: test
  176. projects: $(System.DefaultWorkingDirectory)/Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
  177. arguments: -c $(BuildConfiguration) --filter "SkipCI!=true"
  178. displayName: Run Tests on Window Desktop
  179. - stage: CodeSign
  180. condition: and(succeeded('IntegrationTests'), not(eq(variables['build.reason'], 'PullRequest')))
  181. jobs:
  182. - deployment: CodeSign
  183. displayName: Code Signing
  184. pool:
  185. vmImage: windows-latest
  186. environment: Code Sign
  187. variables:
  188. - group: SignClient Credentials
  189. strategy:
  190. runOnce:
  191. deploy:
  192. steps:
  193. - task: DotNetCoreCLI@2
  194. inputs:
  195. command: custom
  196. custom: tool
  197. arguments: install --tool-path . SignClient
  198. displayName: Install SignTool tool
  199. - pwsh: |
  200. .\SignClient "Sign" `
  201. --baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
  202. --input "**/*.nupkg" `
  203. --config "$(Pipeline.Workspace)\config\signclient.json" `
  204. --user "$(SignClientUser)" `
  205. --secret "$(SignClientSecret)" `
  206. --name "Rx.NET" `
  207. --description "Rx.NET" `
  208. --descriptionUrl "https://github.com/dotnet/reactive"
  209. displayName: Sign packages
  210. - publish: $(Pipeline.Workspace)/BuildPackages
  211. displayName: Publish Signed Packages
  212. artifact: SignedPackages