|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- # Refer: https://aka.ms/yaml
-
- variables:
- shouldDeploy: >-
- ${{ or(
- eq(variables['Build.SourceBranch'], 'refs/heads/develop'),
- eq(variables['Build.SourceBranch'], 'refs/heads/master')
- ) }}
- deployDest: ${{ format('~/web/{0}/', variables['Build.SourceBranchName']) }}
-
- stages:
- - stage: build_test
- displayName: Build and Test
- jobs:
- - job: win_vs2019
- displayName: Windows - VS 2019
- pool:
- vmImage: windows-2019
- steps:
- - pwsh: tools\get-win-openssl.ps1
- displayName: Get OpenSSL for Windows
- - script: python -m pip install poetry && poetry install --no-dev
- displayName: Install Python deps
- - script: |
- echo Loading VS environment
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd" -arch=x64 || exit 1
- echo Executing Build and Tests
- reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f || exit 1
- poetry run dds-ci || exit 1
- move _build\dds.exe _build\dds-win-x64.exe || exit 1
- displayName: Build and Test
- - task: PublishTestResults@2
- displayName: Publish Tests
- condition: succeededOrFailed()
- inputs:
- testResultsFiles: '**/pytest-junit.xml'
- failTaskOnFailedTests: true
- testRunTitle: Windows Tests
- - publish: _build\dds-win-x64.exe
- displayName: Publish
- artifact: dds-win-x64
-
- - job: linux_gcc9
- displayName: Linux - GCC 9
- pool:
- vmImage: ubuntu-18.04
- steps:
- - script: make alpine-static-ci
- displayName: Build and Test
- - task: PublishTestResults@2
- displayName: Publish Tests
- condition: succeededOrFailed()
- inputs:
- testResultsFiles: '**/pytest-junit.xml'
- failTaskOnFailedTests: true
- testRunTitle: Linux Tests
- - publish: _build/dds-linux-x64
- displayName: Publish
- artifact: dds-linux-x64
-
- - job: macos_gcc9
- displayName: macOS - GCC 9
- pool:
- vmImage: macOS-10.15
- steps:
- - script: brew install gcc@9 ccache
- displayName: Get GCC 9
- - script: brew install openssl@1.1
- displayName: Install OpenSSL
- - script: python3 -m pip install poetry
- displayName: Get Python Dependencies
- - script: make macos-ci
- displayName: Build and Test
- - task: PublishTestResults@2
- displayName: Publish Tests
- condition: succeededOrFailed()
- inputs:
- testResultsFiles: '**/pytest-junit.xml'
- failTaskOnFailedTests: true
- testRunTitle: macOS Tests
- - publish: _build/dds-macos-x64
- displayName: Publish
- artifact: dds-macos-x64
-
- - stage: deploy_build
- displayName: Deploy
- condition: and(succeeded(), eq(variables.shouldDeploy, 'true'))
- jobs:
- - job: deploy
- displayName: Deploy (${{variables['Build.SourceBranch']}})
- steps:
- - checkout: none
- - task: DownloadPipelineArtifact@2
- displayName: Download builds
- inputs:
- targetPath: art-dirs/
- - bash: |
- set -eu
- mkdir -p art/
- mv -- $(find art-dirs/ -type f) art/
- displayName: Rearrange
- - task: CopyFilesOverSSH@0
- displayName: Post builds
- inputs:
- sshEndpoint: dds.pizza
- sourceFolder: art/
- targetFolder: ${{ variables.deployDest }}
- failOnEmptySource: true
- overwrite: true
|