-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
262 lines (253 loc) · 8.29 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
variables:
LZFSE_VERSION: '1.0'
jobs:
- job: native_windows
strategy:
maxParallel: 2
matrix:
x64:
BUILD_ARCH: x64
PLATFORM: x64
RID: win7-x64
x86:
BUILD_ARCH: x86
PLATFORM: Win32
RID: win7-x86
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
%VCPKG_INSTALLATION_ROOT%\vcpkg version
set VCPKG_BUILD_TYPE=release
%VCPKG_INSTALLATION_ROOT%\vcpkg install lzfse:%BUILD_ARCH%-windows
displayName: Install native dependencies
- script: |
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\lzfse\%RID%\bin\
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\bin\*.dll %BUILD_ARTIFACTSTAGINGDIRECTORY%\lzfse\%RID%\bin\
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\lzfse\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\lzfse\%RID%\bin\lzfse.copyright
displayName: 'Install'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse/'
artifactName: 'lzfse'
publishLocation: 'Container'
displayName: Publish
- job: native_macos
pool:
vmImage: 'xcode9-macos10.13'
variables:
RID: osx-x64
steps:
- script: |
brew install automake
displayName: Install autotools
- script: |
wget https://github.com/lzfse/lzfse/archive/lzfse-${LZFSE_VERSION}.tar.gz -O lzfse-${LZFSE_VERSION}.tar.gz
tar xvf lzfse-${LZFSE_VERSION}.tar.gz
displayName: Download sources
- script: |
cd lzfse-lzfse-${LZFSE_VERSION}
mkdir build
cd build
cmake ..
DESTDIR=${BUILD_ARTIFACTSTAGINGDIRECTORY}/lzfse/${RID} make install
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse'
artifactName: 'lzfse'
publishLocation: 'Container'
displayName: Publish
- job: native_linux_arm64
variables:
RID: linux-arm64
container:
image: ubuntu:16.04
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo
- script: |
sudo apt-get update
sudo apt-get install -y lsb-release build-essential wget gcc cmake g++-aarch64-linux-gnu
- script: |
lsb_release -a
displayName: Check Ubuntu version
- script: |
wget https://github.com/lzfse/lzfse/archive/lzfse-${LZFSE_VERSION}.tar.gz -O lzfse-${LZFSE_VERSION}.tar.gz
tar xvf lzfse-${LZFSE_VERSION}.tar.gz
displayName: Download sources
- script: |
cd lzfse-lzfse-${LZFSE_VERSION}
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../lzfse.arm64.cmake ..
DESTDIR=${BUILD_ARTIFACTSTAGINGDIRECTORY}/lzfse/${RID} make install
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse'
artifactName: 'lzfse'
publishLocation: 'Container'
displayName: Publish
- job: native_linux_musl_x64
variables:
RID: linux-musl-x64
container:
image: ubuntu:16.04
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo
- script: |
sudo apt-get update
sudo apt-get install -y lsb-release build-essential wget gcc cmake musl-tools
- script: |
lsb_release -a
displayName: Check Ubuntu version
- script: |
wget https://github.com/lzfse/lzfse/archive/lzfse-${LZFSE_VERSION}.tar.gz -O lzfse-${LZFSE_VERSION}.tar.gz
tar xvf lzfse-${LZFSE_VERSION}.tar.gz
displayName: Download sources
- script: |
cd lzfse-lzfse-${LZFSE_VERSION}
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../lzfse.musl-x64.cmake .. ..
DESTDIR=${BUILD_ARTIFACTSTAGINGDIRECTORY}/lzfse/${RID} make install
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse'
artifactName: 'lzfse'
publishLocation: 'Container'
displayName: Publish
- job: native_linux_x64
variables:
RID: linux-x64
container:
image: ubuntu:16.04
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo
- script: |
sudo apt-get update
sudo apt-get install -y lsb-release build-essential wget gcc cmake
- script: |
lsb_release -a
displayName: Check Ubuntu version
- script: |
wget https://github.com/lzfse/lzfse/archive/lzfse-${LZFSE_VERSION}.tar.gz -O lzfse-${LZFSE_VERSION}.tar.gz
tar xvf lzfse-${LZFSE_VERSION}.tar.gz
displayName: Download sources
- script: |
cd lzfse-lzfse-${LZFSE_VERSION}
mkdir build
cd build
cmake ..
DESTDIR=${BUILD_ARTIFACTSTAGINGDIRECTORY}/lzfse/${RID} make install
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse'
artifactName: 'lzfse'
publishLocation: 'Container'
displayName: Publish
- job: build_package
dependsOn:
- native_windows
- native_macos
- native_linux_x64
- native_linux_arm64
pool:
vmImage: 'vs2017-win2016'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: lzfse
- script: |
cd src
set msbuild="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
%msbuild% /t:Restore
%msbuild% /t:pack /p:Configuration=Release /p:PackageOutputPath="%BUILD_ARTIFACTSTAGINGDIRECTORY%\lzfse-net"
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/lzfse-net'
artifactName: 'nuget'
publishLocation: 'Container'
displayName: Publish
- job: build_test_package
dependsOn: build_package
variables:
RID: ubuntu.16.04-x64
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: nuget
- script: |
cd src/lzfse-net.demo
echo 'Adding lzfse version $(Build.BuildNumber)'
dotnet add package -s $(System.ArtifactsDirectory)/nuget -v ${BUILD_BUILDNUMBER//+/-g} lzfse-net
dotnet publish -c Release -f netcoreapp3.0 -r linux-x64 -o $(Build.ArtifactStagingDirectory)/demo/linux-x64
dotnet publish -c Release -f netcoreapp3.0 -r win7-x64 -o $(Build.ArtifactStagingDirectory)/demo/win7-x64
dotnet publish -c Release -f netcoreapp3.0 -r win7-x86 -o $(Build.ArtifactStagingDirectory)/demo/win7-x86
dotnet publish -c Release -f netcoreapp3.0 -r osx-x64 -o $(Build.ArtifactStagingDirectory)/demo/osx-x64
displayName: Build
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/demo'
artifactName: 'demo'
publishLocation: 'Container'
displayName: Publish
- job: linux_test
dependsOn: build_test_package
strategy:
maxParallel: 10
# Roughly match the Linux distros listed here:
# https://github.com/dotnet/core/blob/master/release-notes/3.1/3.1-supported-os.md
matrix:
centos_7:
imageName: centos:7
centos_8:
imageName: centos:8
fedora_29:
imageName: fedora:29
fedora_30:
imageName: fedora:30
fedora_31:
imageName: fedora:31
debian_9:
imageName: debian:9
debian_10:
imageName: debian:10
ubuntu_16_04:
imageName: ubuntu:16.04
ubuntu_18_04:
imageName: ubuntu:18.04
ubuntu_19_10:
imageName: ubuntu:19.10
opensuse_15:
imageName: opensuse/leap:15
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: demo
- script: |
chmod +x ./lzfse-net.demo
./lzfse-net.demo
workingDirectory: $(System.ArtifactsDirectory)/demo/linux-x64
- script: |
ldd liblzfse.so
workingDirectory: $(System.ArtifactsDirectory)/demo/linux-x64