microsoft/onnxruntime-extensions

Public

mirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
c0260ec704bf0434958dff3508406e5d06442d4b

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.pipelines/OneBranch.PullRequest.yml

130lines · modecode

1#################################################################################
2# OneBranch Pipelines - Official #
3# This pipeline was created by EasyStart from a sample located at: #
4# https://aka.ms/obpipelines/easystart/samples #
5# Documentation: https://aka.ms/obpipelines #
6# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
7# Retail Tasks: https://aka.ms/obpipelines/tasks #
8# Support: https://aka.ms/onebranchsup #
9#################################################################################
10
11trigger: none
12
13parameters: # parameters are shown up in ADO UI in a build queue time
14- name: 'debug'
15 displayName: 'Enable debug output'
16 type: boolean
17 default: false
18
19variables:
20 CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)]
21 system.debug: ${{ parameters.debug }}
22 ENABLE_PRS_DELAYSIGN: 1
23 ROOT: $(Build.SourcesDirectory)
24 REPOROOT: $(Build.SourcesDirectory)
25 OUTPUTROOT: $(REPOROOT)\out
26 NUGET_XMLDOC_MODE: none
27 CIBW_BUILD: cp3{7,8,9,10}-*amd64
28 CIBW_ARCHS: AMD64
29 CIBW_BUILD_VERBOSITY: 1
30 DEBIAN_FRONTEND: noninteractive
31
32resources:
33 repositories:
34 - repository: templates
35 type: git
36 name: OneBranch.Pipelines/GovernedTemplates
37 ref: refs/heads/main
38
39extends:
40 template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates
41 parameters:
42 cloudvault:
43 enabled: false
44 globalSdl:
45 tsa:
46 enabled: false
47 binskim:
48 break: true # always break the build on binskim issues in addition to TSA upload
49 analyzeTargetGlob: '**\RelWithDebInfo\ortextensions.dll' # avoid scanning the 3rd party DLLs.
50 codeql:
51 python:
52 enabled: true
53 policheck:
54 break: true # always break the build on policheck issues. You can disable it by setting to 'false'
55 exclusionsFile: '$(REPOROOT)\.config\policheck_exclusions.xml'
56
57 stages:
58 - stage: Windows_Build
59 jobs:
60 - job: main
61 pool:
62 type: windows
63
64 variables:
65 ob_outputDirectory: '$(REPOROOT)\out'
66 ob_sdl_binskim_break: true
67 steps:
68 - script: |
69 @echo off
70 set vswherepath="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
71 for /f "usebackq delims=" %%i in (`%vswherepath% -latest -property installationPath`) do (
72 set vslatest="%%i"
73 if exist "%%i\Common7\Tools\vsdevcmd.bat" (
74 set vsdevcmd="%%i\Common7\Tools\vsdevcmd.bat"
75 )
76 if exist "%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" (
77 set vscmake="%%i\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
78 )
79 if exist "%%i\MSBuild\Current\Bin\amd64\msbuild.exe" (
80 set vsmsbuild="%%i\MSBuild\Current\Bin\amd64\msbuild.exe"
81 )
82 )
83
84 @echo vslatest %vslatest%
85 @echo vsdevcmd %vsdevcmd%
86 @echo vscmake %vscmake%
87 @echo vsmsbuild %vsmsbuild%
88
89 @echo ##vso[task.setvariable variable=vslatest]%vslatest%
90 @echo ##vso[task.setvariable variable=vsdevcmd]%vsdevcmd%
91 @echo ##vso[task.setvariable variable=vscmake]%vscmake%
92 @echo ##vso[task.setvariable variable=vsmsbuild]%vsmsbuild%
93 displayName: 'locate vsdevcmd via vswhere'
94 - script: |
95 call $(vsdevcmd)
96 set PYTHONPATH=
97 set PYTHONHOME=
98 python -m pip install --upgrade pip
99 python -m pip install cibuildwheel numpy
100 python -m cibuildwheel --platform windows --archs AMD64 --output-dir $(REPOROOT)\out
101 displayName: Build wheels
102 - task: SDLNativeRules@3
103 inputs:
104 msBuildArchitecture: amd64
105 setupCommandlines: '"$(vscmake)" $(REPOROOT) -A x64 -B $(REPOROOT)\windows_out -DOCOS_BUILD_PYTHON=ON -DOCOS_ENABLE_CTEST=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo'
106 msBuildCommandline: '"$(vsmsbuild)" "$(REPOROOT)\windows_out\onnxruntime_extensions.sln" /p:RunCodeAnalysis=true /p:platform=x64 /p:configuration=RelWithDebInfo /p:VisualStudioVersion="16.0" /m /p:PreferredToolArchitecture=x64'
107 excludedPaths: '$(REPOROOT)\windows_out#$(Build.SourcesDirectory)\cmake#C:\program files (x86)'
108 displayName: 'Run the PREfast SDL Native Rules for MSBuild'
109 - task: PostAnalysis@2
110 inputs:
111 GdnBreakGdnToolSDLNativeRulesSeverity: Warning
112 GdnBreakGdnToolSDLNativeRules: true
113 displayName: 'Guardian Break'
114 - script: |
115 7z x $(REPOROOT)\out\*.whl -o$(REPOROOT)\out\*
116 displayName: unzip the package
117 - task: onebranch.pipeline.signing@1
118 inputs:
119 command: 'sign'
120 signing_profile: 'external_distribution'
121 files_to_sign: '**/**/*.pyd;**/**/*.dll'
122 search_root: '$(REPOROOT)\out'
123 displayName: 'Sign runtime DLLs'
124 - script: |
125 for /D %%i in ("out\onnxruntime_extensions*-win*") do (
126 7z u %%i.whl .\%%i\*
127 rmdir /s /q %%i
128 )
129 workingDirectory: '$(REPOROOT)'
130 displayName: zip package
131