azure-storage-cpplite/azure-pipelines.yml

163 строки
6.2 KiB
YAML

trigger:
- master
pr:
- master
jobs:
- job: build_test_linux
displayName: Build and Test on Linux
timeoutInMinutes: 60
strategy:
maxParallel: 16
matrix:
UBUNTU1604:
container_image: ubuntu16.04:cpplite
build_type: Release
UBUNTU1804:
container_image: ubuntu18.04:cpplite
build_type: Release
UBUNTU2004:
container_image: ubuntu20.04:cpplite
build_type: Release
UBUNTU2004_DEBUG:
container_image: ubuntu20.04:cpplite
build_type: Debug
UBUNTU2004_GNUTLS:
container_image: ubuntu20.04:cpplite
build_type: Release
extra_cmake_options: -DUSE_OPENSSL=OFF
CENTOS6:
container_image: centos6:cpplite
build_type: Release
extra_cmake_options: -DCMAKE_C_COMPILER=$(source scl_source enable devtoolset-6 && which gcc) -DCMAKE_CXX_COMPILER=$(source scl_source enable devtoolset-6 && which g++)
CENTOS7_DEBUG:
container_image: centos7:cpplite
build_type: Debug
extra_cmake_options: -DCMAKE_C_COMPILER=$(source scl_source enable devtoolset-4 && which gcc) -DCMAKE_CXX_COMPILER=$(source scl_source enable devtoolset-4 && which g++)
CENTOS8:
container_image: centos8:cpplite
build_type: Release
pool:
vmImage: 'ubuntu-16.04'
container:
image: azurecppsdkpipeline.azurecr.io/$(container_image)
endpoint: azure_docker_registry_connection
steps:
- script: |
sed -i 's@DefaultEndpointsProtocol=https;@'${MAPPED_TEST_CONFIGURATION}'@g' test/test_base.h
sed -i 's@DefaultEndpointsProtocol=https;@'${MAPPED_ADLS_TEST_CONFIGURATION}'@g' adls/test/adls_test_base.h
displayName: Set Test Configuration
env:
MAPPED_TEST_CONFIGURATION: $(test_configuration)
MAPPED_ADLS_TEST_CONFIGURATION: $(adls_test_configuration)
- script: |
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_BUILD_TYPE=$(build_type) -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON $(extra_cmake_options)
cmake --build $(Build.BinariesDirectory) -- -j$(nproc)
rm -rf $(Build.BinariesDirectory)
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_BUILD_TYPE=$(build_type) -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON -DBUILD_ADLS=ON $(extra_cmake_options)
cmake --build $(Build.BinariesDirectory) -- -j$(nproc)
displayName: Build
- script: ./azure-storage-test
workingDirectory: $(Build.BinariesDirectory)
displayName: Run Tests
- job: build_test_macos
displayName: Build and Test on macOS
timeoutInMinutes: 60
pool:
vmImage: 'macOS-latest'
steps:
- script: |
sed -i '' 's@DefaultEndpointsProtocol=https;@'${MAPPED_TEST_CONFIGURATION}'@g' test/test_base.h
sed -i '' 's@DefaultEndpointsProtocol=https;@'${MAPPED_ADLS_TEST_CONFIGURATION}'@g' adls/test/adls_test_base.h
displayName: Set Test Configuration
env:
MAPPED_TEST_CONFIGURATION: $(test_configuration)
MAPPED_ADLS_TEST_CONFIGURATION: $(adls_test_configuration)
- script: brew install openssl cmake catch2
displayName: Install Dependencies
- script: |
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON
cmake --build $(Build.BinariesDirectory) -- -j$(nproc)
rm -rf $(Build.BinariesDirectory)
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_BUILD_TYPE=Release -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON -DBUILD_ADLS=ON
cmake --build $(Build.BinariesDirectory) -- -j$(nproc)
displayName: Build
- script: ./azure-storage-test
workingDirectory: $(Build.BinariesDirectory)
displayName: Run Tests
- job: build_test_windows
displayName: Build and Test on Windows
timeoutInMinutes: 60
strategy:
maxParallel: 16
matrix:
VS2015:
vm_image: vs2017-win2016
build_type: Release
platform: x64
toolset: v140
VS2017:
vm_image: vs2017-win2016
build_type: Release
platform: x64
toolset: v141
VS2017_WIN32:
vm_image: vs2017-win2016
build_type: Debug
platform: Win32
toolset: v141
VS2019:
vm_image: windows-2019
build_type: Debug
platform: x64
toolset: v142
pool:
vmImage: $(vm_image)
steps:
- powershell: |
(Get-Content test\test_base.h) -replace 'DefaultEndpointsProtocol=https;', "$Env:MAPPED_TEST_CONFIGURATION" | Out-File -encoding ASCII test\test_base.h
(Get-Content adls\test\adls_test_base.h) -replace 'DefaultEndpointsProtocol=https;', "$Env:MAPPED_ADLS_TEST_CONFIGURATION" | Out-File -encoding ASCII adls\test\adls_test_base.h
displayName: Set Test Configuration
env:
MAPPED_TEST_CONFIGURATION: $(test_configuration)
MAPPED_ADLS_TEST_CONFIGURATION: $(adls_test_configuration)
- powershell: |
Invoke-WebRequest -Uri https://codeload.github.com/microsoft/vcpkg/zip/master -OutFile vcpkg-master.zip
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("vcpkg-master.zip", "C:\")
cd C:\vcpkg-master
.\bootstrap-vcpkg.bat
.\vcpkg install curl[winssl]:x86-windows curl[winssl]:x64-windows catch2:x86-windows catch2:x64-windows
displayName: Install Dependencies
- powershell: |
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg-master\scripts\buildsystems\vcpkg.cmake -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON -A $(platform) -T $(toolset)
cmake --build $(Build.BinariesDirectory) --config $(build_type)
Remove-Item $(Build.BinariesDirectory) -Recurse -Force
cmake CMakeLists.txt -B$(Build.BinariesDirectory) -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg-master\scripts\buildsystems\vcpkg.cmake -DBUILD_SAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=ON -DBUILD_ADLS=ON -A $(platform) -T $(toolset)
cmake --build $(Build.BinariesDirectory) --config $(build_type)
displayName: Build
- powershell: |
.\azure-storage-test.exe
workingDirectory: $(Build.BinariesDirectory)\$(build_type)
displayName: Run Tests