forked from kendryte/nncase
/
azure-pipelines.yml
180 lines (150 loc) · 4.61 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
branches:
include:
- '*'
jobs:
- job: Linux
timeoutInMinutes: 0
pool:
vmImage: 'ubuntu-16.04'
variables:
CC: gcc-10
CXX: g++-10
steps:
- checkout: self
submodules: true
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install g++-10 -y
displayName: 'Install GNU C++ compiler'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: |
pip install conan tensorflow==2.4.1 matplotlib pillow onnxruntime
pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
displayName: 'Install Conan'
- script: |
mkdir out && cd out
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
strip bin/ncc
displayName: 'Build'
- script: |
pip install pytest
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'Test'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'out/bin'
includeRootFolder: false
archiveType: 'tar' # Options: zip, 7z, tar, wim
tarCompression: 'xz' # Optional. Options: gz, bz2, xz, none
archiveFile: '$(Build.ArtifactStagingDirectory)/ncc_linux_x86_64.tar.xz'
replaceExistingArchive: true
verbose: true
displayName: 'Publish'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)/ncc_linux_x86_64.tar.xz
artifactName: ncc_linux_x86_64
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- job: Windows
timeoutInMinutes: 0
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
submodules: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: |
pip install conan tensorflow==2.4.1 matplotlib pillow onnxruntime
pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
displayName: 'Install Conan'
- script: |
md out && cd out
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release
displayName: 'Build'
- task: MSBuild@1
inputs:
solution: 'out/nncase.sln'
msbuildArchitecture: 'x64'
configuration: 'Release'
msbuildArguments: '-m'
- script: |
pip install pytest
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'Test'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'out/bin'
includeRootFolder: false
archiveType: 'zip' # Options: zip, 7z, tar, wim
archiveFile: '$(Build.ArtifactStagingDirectory)/ncc_win_x86_64.zip'
replaceExistingArchive: true
verbose: true
displayName: 'Publish'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)/ncc_win_x86_64.zip
artifactName: ncc_win_x86_64
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- job: MacOS
timeoutInMinutes: 0
pool:
vmImage: 'macOS-10.14'
steps:
- checkout: self
submodules: true
- script: |
xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools/
displayName: 'Setup XCode'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- script: |
pip install conan tensorflow==2.4.1 matplotlib pillow onnxruntime
pip install torch torchvision
displayName: 'Install Conan'
- script: |
mkdir out && cd out
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
strip bin/ncc
hdiutil create -srcfolder bin ncc_osx_x86_64.dmg
displayName: 'Build'
- script: |
pip install pytest
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'Test'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: out/ncc_osx_x86_64.dmg
artifactName: ncc_osx_x86_64
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'