forked from LibUsbDotNet/LibUsbDotNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
137 lines (121 loc) · 4.13 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
variables:
libusbBuild: 208 # 20201202.4
libusbkBuild: 209 # 20201202.1
jobs:
- job: windows
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: 'libusbdotnet'
pipeline: '2'
runVersion: 'specific'
runId: $(libusbBuild)
artifact: 'windows'
path: '$(System.ArtifactsDirectory)/drop'
displayName: 'download libusb windows artifacts'
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: 'libusbdotnet'
pipeline: '2'
runVersion: 'specific'
runId: $(libusbBuild)
artifact: 'macos'
path: '$(System.ArtifactsDirectory)/drop'
displayName: 'download libusb macOS artifacts'
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: 'libusbdotnet'
pipeline: '3'
runVersion: 'specific'
runId: $(libusbkBuild)
artifact: 'windows'
path: '$(System.ArtifactsDirectory)/drop'
displayName: 'download libusbK artifacts'
- script: |
dotnet pack src\LibUsbDotNet\LibUsbDotNet.csproj -c Release -o %BUILD_ARTIFACTSTAGINGDIRECTORY%
displayName: 'Build'
- script: |
set PATH=%PATH%;%SYSTEM_ARTIFACTSDIRECTORY%\drop\runtimes\win-x64\native
dotnet test src\LibUsbDotNet.Tests\LibUsbDotNet.Tests.csproj -p:RuntimeIdentifier=win7-x64
displayName: 'Test (x64)'
- script: |
set PATH=%PATH%;%SYSTEM_ARTIFACTSDIRECTORY%\drop\runtimes\win-x86\native
dotnet test src\LibUsbDotNet.Tests\LibUsbDotNet.Tests.csproj -p:RuntimeIdentifier=win7-x86
displayName: 'Test (x86)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
publishLocation: 'Container'
displayName: 'Publish artifacts'
- job: osx
pool:
vmImage: 'macOS-10.15'
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
project: 'libusbdotnet'
pipeline: '2'
runVersion: 'specific'
runId: $(libusbBuild)
artifact: 'macos'
path: '$(System.ArtifactsDirectory)/drop'
displayName: 'download libusb macOS artifacts'
- script: |
dotnet pack src/LibUsbDotNet/LibUsbDotNet.csproj -c Release
displayName: 'Build'
- script: |
export LD_LIBRARY_PATH=$SYSTEM_ARTIFACTSDIRECTORY/drop/runtimes/osx-x64/native:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
ls $SYSTEM_ARTIFACTSDIRECTORY/drop/runtimes/osx-x64/native
dotnet test src/LibUsbDotNet.Tests/LibUsbDotNet.Tests.csproj -p:RuntimeIdentifier=osx.10.12-x64
displayName: 'Test (x64)'
- job: ubuntu
pool:
vmImage: 'ubuntu-16.04'
container:
image: 'mcr.microsoft.com/dotnet/core/sdk:3.1-bionic'
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 install -y libusb-1.0-0
displayName: 'Install dependencies'
- script: |
dotnet pack src/LibUsbDotNet/LibUsbDotNet.csproj -c Release
displayName: 'Build'
- script: |
dotnet test src/LibUsbDotNet.Tests/LibUsbDotNet.Tests.csproj -p:RuntimeIdentifier=linux-x64
displayName: 'Test (x64)'
- job: centos
pool:
vmImage: 'ubuntu-16.04'
container:
# image: 'registry.centos.org/dotnet/dotnet-31-centos7'
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
- script: |
sudo yum install -y libusb
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install -y dotnet-sdk-3.1
displayName: 'Install dependencies'
- script: |
dotnet pack src/LibUsbDotNet/LibUsbDotNet.csproj -c Release
displayName: 'Build'
- script: |
dotnet test src/LibUsbDotNet.Tests/LibUsbDotNet.Tests.csproj -p:RuntimeIdentifier=linux-x64
displayName: 'Test (x64)'