您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

110 行
3.8KB

  1. # Refer: https://aka.ms/yaml
  2. variables:
  3. shouldDeploy: >-
  4. ${{ or(
  5. eq(variables['Build.SourceBranch'], 'refs/heads/develop'),
  6. eq(variables['Build.SourceBranch'], 'refs/heads/master')
  7. ) }}
  8. deployDest: ${{ format('~/web/{0}/', variables['Build.SourceBranchName']) }}
  9. stages:
  10. - stage: build_test
  11. displayName: Build and Test
  12. jobs:
  13. - job: win_vs2019
  14. displayName: Windows - VS 2019
  15. pool:
  16. vmImage: windows-2019
  17. steps:
  18. - pwsh: tools\get-win-openssl.ps1
  19. displayName: Get OpenSSL for Windows
  20. - script: python -m pip install poetry && poetry install --no-dev
  21. displayName: Install Python deps
  22. - script: |
  23. echo Loading VS environment
  24. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd" -arch=x64 || exit 1
  25. echo Executing Build and Tests
  26. reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1
  27. poetry run dds-ci || exit 1
  28. move _build\dds.exe _build\dds-win-x64.exe || exit 1
  29. displayName: Build and Test
  30. - task: PublishTestResults@2
  31. displayName: Publish Tests
  32. condition: succeededOrFailed()
  33. inputs:
  34. testResultsFiles: '**/pytest-junit.xml'
  35. failTaskOnFailedTests: true
  36. testRunTitle: Windows Tests
  37. - publish: _build\dds-win-x64.exe
  38. displayName: Publish
  39. artifact: dds-win-x64
  40. - job: linux_gcc9
  41. displayName: Linux - GCC 9
  42. pool:
  43. vmImage: ubuntu-18.04
  44. steps:
  45. - script: make alpine-static-ci
  46. displayName: Build and Test
  47. - task: PublishTestResults@2
  48. displayName: Publish Tests
  49. condition: succeededOrFailed()
  50. inputs:
  51. testResultsFiles: '**/pytest-junit.xml'
  52. failTaskOnFailedTests: true
  53. testRunTitle: Linux Tests
  54. - publish: _build/dds-linux-x64
  55. displayName: Publish
  56. artifact: dds-linux-x64
  57. - job: macos_gcc9
  58. displayName: macOS - GCC 9
  59. pool:
  60. vmImage: macOS-10.15
  61. steps:
  62. - script: brew install gcc@9 ccache
  63. displayName: Get GCC 9
  64. - script: brew install openssl@1.1
  65. displayName: Install OpenSSL
  66. - script: python3 -m pip install poetry
  67. displayName: Get Python Dependencies
  68. - script: make macos-ci
  69. displayName: Build and Test
  70. - task: PublishTestResults@2
  71. displayName: Publish Tests
  72. condition: succeededOrFailed()
  73. inputs:
  74. testResultsFiles: '**/pytest-junit.xml'
  75. failTaskOnFailedTests: true
  76. testRunTitle: macOS Tests
  77. - publish: _build/dds-macos-x64
  78. displayName: Publish
  79. artifact: dds-macos-x64
  80. - stage: deploy_build
  81. displayName: Deploy
  82. condition: and(succeeded(), eq(variables.shouldDeploy, 'true'))
  83. jobs:
  84. - job: deploy
  85. displayName: Deploy (${{variables['Build.SourceBranch']}})
  86. steps:
  87. - checkout: none
  88. - task: DownloadPipelineArtifact@2
  89. displayName: Download builds
  90. inputs:
  91. targetPath: art-dirs/
  92. - bash: |
  93. set -eu
  94. mkdir -p art/
  95. mv -- $(find art-dirs/ -type f) art/
  96. displayName: Rearrange
  97. - task: CopyFilesOverSSH@0
  98. displayName: Post builds
  99. inputs:
  100. sshEndpoint: dds.pizza
  101. sourceFolder: art/
  102. targetFolder: ${{ variables.deployDest }}
  103. failOnEmptySource: true
  104. overwrite: true