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.0KB

5 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. - script: |
  19. echo Loading VS environment
  20. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd" -arch=x64 || exit 1
  21. echo Executing Build and Tests
  22. reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1
  23. python -m pip install pytest pytest-xdist || exit 1
  24. python -u tools/ci.py -B download -T tools\msvc.jsonc || exit 1
  25. move _build\dds.exe _build\dds-win-x64.exe || exit 1
  26. displayName: Build and Test
  27. - publish: _build\dds-win-x64.exe
  28. displayName: Publish
  29. artifact: dds-win-x64
  30. - job: linux_gcc9
  31. displayName: Linux - GCC 9
  32. pool:
  33. vmImage: ubuntu-18.04
  34. steps:
  35. - script: |
  36. set -eu
  37. sudo apt update -y
  38. sudo apt install -y python3-minimal python3-setuptools g++-9 ccache
  39. python3 -m pip install pytest pytest-xdist
  40. displayName: Prepare System
  41. - script: make linux-ci
  42. displayName: Build and Test
  43. - publish: _build/dds-linux-x64
  44. displayName: Publish
  45. artifact: dds-linux-x64
  46. - job: macos_gcc9
  47. displayName: macOS - GCC 9
  48. pool:
  49. vmImage: macOS-10.14
  50. steps:
  51. - script: brew install gcc@9 ccache
  52. displayName: Prepare System
  53. - script: |
  54. set -eu
  55. python3 -m pip install pytest pytest-xdist
  56. make macos-ci
  57. displayName: Build and Test
  58. - publish: _build/dds-macos-x64
  59. displayName: Publish
  60. artifact: dds-macos-x64
  61. - stage: deploy_build
  62. displayName: Deploy
  63. condition: and(succeeded(), eq(variables.shouldDeploy, 'true'))
  64. jobs:
  65. - job: deploy
  66. displayName: Deploy (${{variables['Build.SourceBranch']}})
  67. steps:
  68. - checkout: none
  69. - task: DownloadPipelineArtifact@2
  70. displayName: Download builds
  71. inputs:
  72. targetPath: art-dirs/
  73. - bash: |
  74. set -eu
  75. mkdir -p art/
  76. mv -- $(find art-dirs/ -type f) art/
  77. displayName: Rearrange
  78. - task: CopyFilesOverSSH@0
  79. displayName: Post builds
  80. inputs:
  81. sshEndpoint: dds.pizza
  82. sourceFolder: art/
  83. targetFolder: ${{ variables.deployDest }}
  84. failOnEmptySource: true
  85. overwrite: true