You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

azure-pipelines.yml 3.4KB

5 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 pytest pytest-xdist
  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. python -u tools/ci.py -B download -T tools\msvc.jsonc || exit 1
  28. move _build\dds.exe _build\dds-win-x64.exe || exit 1
  29. displayName: Build and Test
  30. - publish: _build\dds-win-x64.exe
  31. displayName: Publish
  32. artifact: dds-win-x64
  33. - job: linux_gcc9
  34. displayName: Linux - GCC 9
  35. pool:
  36. vmImage: ubuntu-18.04
  37. steps:
  38. - script: sudo apt-get -y update
  39. displayName: APT Update
  40. - script: sudo apt-get -y install g++-9 ccache
  41. displayName: Get GCC 9
  42. - script: sudo apt-get -y install python3-minimal python3-setuptools
  43. displayName: Get Python 3
  44. - script: python3 -m pip install pytest pytest-xdist
  45. displayName: Get Python Dependencies
  46. - script: make linux-ci
  47. displayName: Build and Test
  48. - publish: _build/dds-linux-x64
  49. displayName: Publish
  50. artifact: dds-linux-x64
  51. - job: macos_gcc9
  52. displayName: macOS - GCC 9
  53. pool:
  54. vmImage: macOS-10.15
  55. steps:
  56. - script: brew install gcc@9 ccache
  57. displayName: Get GCC 9
  58. - script: brew install openssl@1.1
  59. displayName: Install OpenSSL
  60. - script: python3 -m pip install pytest pytest-xdist
  61. displayName: Get Python Dependencies
  62. - script: make macos-ci
  63. displayName: Build and Test
  64. - publish: _build/dds-macos-x64
  65. displayName: Publish
  66. artifact: dds-macos-x64
  67. - stage: deploy_build
  68. displayName: Deploy
  69. condition: and(succeeded(), eq(variables.shouldDeploy, 'true'))
  70. jobs:
  71. - job: deploy
  72. displayName: Deploy (${{variables['Build.SourceBranch']}})
  73. steps:
  74. - checkout: none
  75. - task: DownloadPipelineArtifact@2
  76. displayName: Download builds
  77. inputs:
  78. targetPath: art-dirs/
  79. - bash: |
  80. set -eu
  81. mkdir -p art/
  82. mv -- $(find art-dirs/ -type f) art/
  83. displayName: Rearrange
  84. - task: CopyFilesOverSSH@0
  85. displayName: Post builds
  86. inputs:
  87. sshEndpoint: dds.pizza
  88. sourceFolder: art/
  89. targetFolder: ${{ variables.deployDest }}
  90. failOnEmptySource: true
  91. overwrite: true