-
Notifications
You must be signed in to change notification settings - Fork 44
/
azure-pipelines.yml
162 lines (141 loc) · 6.16 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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