This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathazure-pipelines.yml
201 lines (195 loc) · 6.04 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
variables:
LIBJPEG_TURBO_VERSION: '2.1.3'
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: 'windows-2019'
steps:
- script: |
%VCPKG_INSTALLATION_ROOT%\vcpkg version
%VCPKG_INSTALLATION_ROOT%\vcpkg integrate install
set VCPKG_BUILD_TYPE=release
%VCPKG_INSTALLATION_ROOT%\vcpkg install libjpeg-turbo:%BUILD_ARCH%-windows
displayName: Install native dependencies
- script: |
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\libjpeg-turbo\%RID%\bin\
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\bin\*.dll %BUILD_ARTIFACTSTAGINGDIRECTORY%\libjpeg-turbo\%RID%\bin\
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\libjpeg-turbo\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\libjpeg-turbo\%RID%\bin\libjpeg-turbo.copyright
displayName: 'Install'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libjpeg-turbo/'
artifactName: 'libjpeg-turbo'
publishLocation: 'Container'
displayName: Publish
- job: native_macos
pool:
vmImage: 'macOS-10.15'
variables:
TARGET: x86_64-apple-darwin
RID: osx-x64
steps:
- script: |
brew install autoconf automake libtool pkg-config nasm
displayName: Install autotools, nasm
- script: |
wget https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${LIBJPEG_TURBO_VERSION}.tar.gz -O libjpeg-turbo-${LIBJPEG_TURBO_VERSION}.tar.gz
tar xvf libjpeg-turbo-${LIBJPEG_TURBO_VERSION}.tar.gz
displayName: Download sources
- script: |
mkdir build
cd build
cmake -G"Unix Makefiles" ../libjpeg-turbo-${LIBJPEG_TURBO_VERSION} -DCMAKE_INSTALL_PREFIX=${BUILD_ARTIFACTSTAGINGDIRECTORY}/libjpeg-turbo/$RID
make
displayName: Build
- script: |
cd build
make install
displayName: Install
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libjpeg-turbo'
artifactName: 'libjpeg-turbo'
publishLocation: 'Container'
displayName: Publish
- job: test_windows
dependsOn:
- native_windows
- native_macos
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: libjpeg-turbo
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.0.100
- script: |
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\Quamotion.TurboJpegWrapper
dotnet restore
dotnet build -c Release
dotnet pack -c Release -o %BUILD_ARTIFACTSTAGINGDIRECTORY%\Quamotion.TurboJpegWrapper
displayName: Build
- script: |
cd Quamotion.TurboJpegWrapper.Tests
set PATH=%PATH%;%SYSTEM_ARTIFACTSDIRECTORY%\libjpeg-turbo\win7-x64\bin\
echo %PATH%
dotnet test -c Release
displayName: Test
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/Quamotion.TurboJpegWrapper'
artifactName: 'TurboJpegWrapper-$(Build.BuildNumber)'
publishLocation: 'Container'
displayName: Publish
- job: test_macos
dependsOn:
- native_windows
- native_macos
pool:
vmImage: 'macOS-10.15'
variables:
RID: osx-x64
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 6.0.100
- task: DownloadBuildArtifacts@0
inputs:
artifactName: libjpeg-turbo
- script: |
dotnet restore
dotnet build -c Release
displayName: Build
- script: |
cd Quamotion.TurboJpegWrapper.Tests
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SYSTEM_ARTIFACTSDIRECTORY}/libjpeg-turbo/${RID}/lib/
echo $LD_LIBRARY_PATH
dotnet test -c Release
displayName: Test
- job: test_ubuntu_20_04
dependsOn:
- native_windows
- native_macos
variables:
RID: ubuntu.20.04-x64
pool:
vmImage: 'ubuntu-20.04'
container:
image: mcr.microsoft.com/dotnet/sdk:6.0-focal
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
- task: DownloadBuildArtifacts@0
inputs:
artifactName: libjpeg-turbo
- script: |
sudo apt-get update
sudo apt-get install -y libc6-dev libgdiplus libcurl4 libturbojpeg
displayName: Install libgdiplus, libcurl
- script: |
dotnet restore
dotnet build -c Release
displayName: Build
- script: |
cd Quamotion.TurboJpegWrapper.Tests
echo $LD_LIBRARY_PATH
dotnet test -c Release
displayName: Test
- job: test_centos_7
dependsOn:
- native_windows
- native_macos
variables:
RID: centos.7-x64
pool:
vmImage: 'ubuntu-20.04'
container:
image: centos:7
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "yum install -y sudo"
displayName: Set up sudo
- task: DownloadBuildArtifacts@0
inputs:
artifactName: libjpeg-turbo
- script: |
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
# Work around https://github.com/dotnet/core/issues/3853
sudo yum install -y https://packages.microsoft.com/centos/7/prod/netstandard-targeting-pack-2.1.0-x64.rpm
sudo yum install -y dotnet-sdk-6.0
displayName: Install .NET 6.0 SDK
- script: |
sudo yum-config-manager -y --add-repo https://download.mono-project.com/repo/centos7-stable.repo
sudo yum install -y libgdiplus turbojpeg
displayName: Install libjpeg-turbo native binaries
- script: |
dotnet restore
dotnet build -c Release
displayName: Build
- script: |
cd Quamotion.TurboJpegWrapper.Tests
echo $LD_LIBRARY_PATH
dotnet test -c Release
displayName: Test