mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
simplify Web CI pipeline (#9094)
This commit is contained in:
parent
438175cb34
commit
0183492931
4 changed files with 1 additions and 390 deletions
|
|
@ -1,44 +0,0 @@
|
|||
parameters:
|
||||
- name: NpmTag
|
||||
type: string
|
||||
default: 'dev'
|
||||
|
||||
jobs:
|
||||
- job: publish_onnxruntime_web
|
||||
continueOnError: true
|
||||
pool: 'Win-CPU-2019'
|
||||
|
||||
timeoutInMinutes: 30
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: none
|
||||
submodules: false
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: 'NPM_packages'
|
||||
path: $(Pipeline.Workspace)\NPM_packages
|
||||
displayName: 'Get packed artifacts'
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '14.x'
|
||||
- script: |
|
||||
dir /b onnxruntime-common* > ort-common_filename.txt
|
||||
set /p __ort_common_pkg_filename__=<ort-common_filename.txt
|
||||
echo.Publishing package %__ort_common_pkg_filename__% ...
|
||||
npm publish %__ort_common_pkg_filename__% --tag ${{ parameters.NpmTag }} --dry-run
|
||||
workingDirectory: '$(Pipeline.Workspace)\NPM_packages'
|
||||
displayName: 'publish onnxruntime-common ...'
|
||||
- script: |
|
||||
dir /b onnxruntime-web* > ort-web_filename.txt
|
||||
set /p __ort_web_pkg_filename__=<ort-web_filename.txt
|
||||
echo.Publishing package %__ort_web_pkg_filename__% ...
|
||||
npm publish %__ort_web_pkg_filename__% --tag ${{ parameters.NpmTag }} --dry-run
|
||||
workingDirectory: '$(Pipeline.Workspace)\NPM_packages'
|
||||
displayName: 'publish onnxruntime-web ...'
|
||||
- template: component-governance-component-detection-steps.yml
|
||||
parameters :
|
||||
condition : 'succeeded'
|
||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
|
|
@ -3,37 +3,23 @@ parameters:
|
|||
displayName: 'NPM packages publish configuration'
|
||||
type: string
|
||||
values:
|
||||
- 'no'
|
||||
- 'nightly (@dev)'
|
||||
- 'release candidate (@rc)'
|
||||
- 'production (@latest)'
|
||||
- 'custom'
|
||||
default: no
|
||||
default: 'nightly (@dev)'
|
||||
|
||||
variables:
|
||||
# pipeline should define the following varaibles
|
||||
# ExtraBuildArgs
|
||||
# VersionSuffix
|
||||
# NpmTag
|
||||
|
||||
${{ if eq(parameters.NpmPublish, 'no') }}:
|
||||
DoPublish: false
|
||||
VersionSuffix: ''
|
||||
NpmTag: ''
|
||||
${{ if eq(parameters.NpmPublish, 'nightly (@dev)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: '-dev.${YYYYMMDD}.${REV}'
|
||||
NpmTag: 'dev'
|
||||
${{ if eq(parameters.NpmPublish, 'release candidate (@rc)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: '-rc'
|
||||
NpmTag: 'rc'
|
||||
${{ if eq(parameters.NpmPublish, 'production (@latest)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: ''
|
||||
NpmTag: 'latest'
|
||||
${{ if eq(parameters.NpmPublish, 'custom') }}:
|
||||
DoPublish: true
|
||||
|
||||
stages:
|
||||
- stage: Extract_commit
|
||||
|
|
@ -104,23 +90,3 @@ stages:
|
|||
- template: templates/win-web-multi-browsers.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
|
||||
- stage: Publish_package
|
||||
dependsOn:
|
||||
- Build_web_Debug
|
||||
- Build_web_Release
|
||||
- Test_web_BrowserStack
|
||||
- Test_web_MultiBrowsers
|
||||
condition:
|
||||
and(succeeded(), or(and(eq(variables['Build.Reason'], 'Scheduled'),
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||
),
|
||||
and(eq(variables['Build.Reason'], 'Manual'),
|
||||
eq(variables['DoPublish'], true)
|
||||
)
|
||||
)
|
||||
)
|
||||
jobs:
|
||||
- template: templates/win-web-publish.yml
|
||||
parameters:
|
||||
NpmTag: '$(NpmTag)'
|
||||
|
|
|
|||
|
|
@ -1,126 +0,0 @@
|
|||
parameters:
|
||||
- name: NpmPublish
|
||||
displayName: 'NPM packages publish configuration'
|
||||
type: string
|
||||
values:
|
||||
- 'no'
|
||||
- 'nightly (@dev)'
|
||||
- 'release candidate (@rc)'
|
||||
- 'production (@latest)'
|
||||
- 'custom'
|
||||
default: no
|
||||
|
||||
variables:
|
||||
# pipeline should define the following varaibles
|
||||
# ExtraBuildArgs
|
||||
# VersionSuffix
|
||||
# NpmTag
|
||||
|
||||
${{ if eq(parameters.NpmPublish, 'no') }}:
|
||||
DoPublish: false
|
||||
VersionSuffix: ''
|
||||
NpmTag: ''
|
||||
${{ if eq(parameters.NpmPublish, 'nightly (@dev)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: '-dev.${YYYYMMDD}.${REV}'
|
||||
NpmTag: 'dev'
|
||||
${{ if eq(parameters.NpmPublish, 'release candidate (@rc)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: '-rc'
|
||||
NpmTag: 'rc'
|
||||
${{ if eq(parameters.NpmPublish, 'production (@latest)') }}:
|
||||
DoPublish: true
|
||||
VersionSuffix: ''
|
||||
NpmTag: 'latest'
|
||||
${{ if eq(parameters.NpmPublish, 'custom') }}:
|
||||
DoPublish: true
|
||||
|
||||
stages:
|
||||
- stage: Extract_commit
|
||||
jobs:
|
||||
- job: Extract_commit
|
||||
pool: 'Win-CPU-2019'
|
||||
timeoutInMinutes: 30
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: none
|
||||
fetchDepth: 1
|
||||
submodules: false
|
||||
- script: |
|
||||
echo.$(Build.SourceVersion)
|
||||
echo.$(Build.SourceVersion)>$(Build.ArtifactStagingDirectory)\__commit.txt
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Pipeline Artifact'
|
||||
inputs:
|
||||
artifactName: '__commit'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
- stage: Build_wasm_Debug
|
||||
dependsOn: Extract_commit
|
||||
jobs:
|
||||
- template: templates/win-wasm-ci.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Debug'
|
||||
ExtraBuildArgs: '$(ExtraBuildArgs)'
|
||||
|
||||
- stage: Build_web_Debug
|
||||
dependsOn: Build_wasm_Debug
|
||||
jobs:
|
||||
- template: templates/win-web-ci.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Debug'
|
||||
|
||||
- stage: Build_wasm_Release
|
||||
dependsOn: Extract_commit
|
||||
jobs:
|
||||
- template: templates/win-wasm-ci.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Release'
|
||||
ExtraBuildArgs: '--skip_tests --disable_wasm_exception_catching --disable_rtti $(ExtraBuildArgs)'
|
||||
|
||||
- stage: Build_web_Release
|
||||
dependsOn: Build_wasm_Release
|
||||
jobs:
|
||||
- template: templates/win-web-ci.yml
|
||||
parameters:
|
||||
NpmVersionSuffix: '$(VersionSuffix)'
|
||||
CommitOverride: true
|
||||
BuildConfig: 'Release'
|
||||
|
||||
- stage: Test_web_BrowserStack
|
||||
dependsOn: Build_wasm_Release
|
||||
jobs:
|
||||
- template: templates/web-browserstack-ci.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
|
||||
- stage: Test_web_MultiBrowsers
|
||||
dependsOn: Build_wasm_Release
|
||||
jobs:
|
||||
- template: templates/win-web-multi-browsers.yml
|
||||
parameters:
|
||||
CommitOverride: true
|
||||
|
||||
- stage: Publish_package
|
||||
dependsOn:
|
||||
- Build_web_Debug
|
||||
- Build_web_Release
|
||||
- Test_web_BrowserStack
|
||||
- Test_web_MultiBrowsers
|
||||
condition:
|
||||
and(succeeded(), or(and(eq(variables['Build.Reason'], 'Scheduled'),
|
||||
eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||
),
|
||||
and(eq(variables['Build.Reason'], 'Manual'),
|
||||
eq(variables['DoPublish'], true)
|
||||
)
|
||||
)
|
||||
)
|
||||
jobs:
|
||||
- template: templates/win-web-publish.yml
|
||||
parameters:
|
||||
NpmTag: '$(NpmTag)'
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
jobs:
|
||||
- job: build_onnxruntime_web_browserstack
|
||||
pool: Onnxruntime-BrowserStack-for-Web
|
||||
timeoutInMinutes: 30
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: false
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'specific'
|
||||
project: 'onnxruntime'
|
||||
pipeline: 161
|
||||
preferTriggeringPipeline: true
|
||||
artifact: '__commit'
|
||||
path: $(Pipeline.Workspace)
|
||||
displayName: 'Get commit SHA'
|
||||
- script: |
|
||||
__commit__=$(<$(Pipeline.Workspace)/__commit.txt)
|
||||
__commit__=${__commit__//[$'\t\r\n']}
|
||||
git fetch origin $__commit__:refs/remotes/origin/$__commit__
|
||||
git checkout --force $__commit__
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
displayName: 'Read commit SHA and checkout'
|
||||
- script: |
|
||||
git submodule sync -- cmake/external/onnx
|
||||
git submodule update --init -- cmake/external/onnx
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
displayName: 'Checkout submodule onnx'
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '14.x'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'specific'
|
||||
project: 'onnxruntime'
|
||||
pipeline: 161
|
||||
preferTriggeringPipeline: true
|
||||
patterns: 'Release_*/**/*'
|
||||
path: $(Pipeline.Workspace)/artifacts
|
||||
displayName: 'Download WebAssembly artifacts'
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Pipeline.Workspace)/artifacts
|
||||
contents: |
|
||||
**/*.wasm
|
||||
targetFolder: $(Build.SourcesDirectory)/js/web/dist
|
||||
flattenFolders: true
|
||||
displayName: 'Binplace dist files'
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Pipeline.Workspace)/artifacts
|
||||
contents: |
|
||||
**/*.js
|
||||
targetFolder: $(Build.SourcesDirectory)/js/web/lib/wasm/binding
|
||||
flattenFolders: true
|
||||
displayName: 'Binplace js files'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js'
|
||||
displayName: 'npm ci /js/'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/common'
|
||||
displayName: 'npm ci /js/common/'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
||||
displayName: 'npm ci /js/web/'
|
||||
- task: BrowserStackConfig@0
|
||||
inputs:
|
||||
BrowserStackServiceEndPoint: 'BrowserStack Connection'
|
||||
browserstackLocal: true
|
||||
displayName: 'BrowserStack configuration setup'
|
||||
timeoutInMinutes: 20
|
||||
- script: |
|
||||
export ONNXJS_TEST_BS_BROWSERS=BS_MAC_11_Safari_14,BS_MAC_11_Chrome_91,BS_ANDROID_11_Pixel_5
|
||||
npm test -- suite0 --env=bs --wasm-init-timeout=30000 --file-cache
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
||||
displayName: 'npm test (Suite0, BS_ANDROID, BS_MAC)'
|
||||
env:
|
||||
BROWSERSTACK_ACCESS_KEY: $(BROWSERSTACK_ACCESS_KEY)
|
||||
BROWSERSTACK_USERNAME: $(BROWSERSTACK_USERNAME)
|
||||
- script: |
|
||||
export ONNXJS_TEST_BS_BROWSERS=BS_IOS_14_iPhoneXS
|
||||
npm test -- suite1 --env=bs --wasm-init-timeout=30000 --file-cache --backend=wasm
|
||||
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
||||
displayName: 'npm test (Suite1, BS_IOS)'
|
||||
env:
|
||||
BROWSERSTACK_ACCESS_KEY: $(BROWSERSTACK_ACCESS_KEY)
|
||||
BROWSERSTACK_USERNAME: $(BROWSERSTACK_USERNAME)
|
||||
- task: BrowserStackStopLocal@0
|
||||
- task: BrowserStackResults@0
|
||||
displayName: 'BrowserStack results'
|
||||
continueOnError: true
|
||||
timeoutInMinutes: 10
|
||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
|
||||
- job: build_onnxruntime_web_windows
|
||||
pool:
|
||||
vmImage: windows-latest
|
||||
timeoutInMinutes: 30
|
||||
workspace:
|
||||
clean: all
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: false
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'specific'
|
||||
project: 'onnxruntime'
|
||||
pipeline: 161
|
||||
preferTriggeringPipeline: true
|
||||
artifact: '__commit'
|
||||
path: $(Pipeline.Workspace)
|
||||
displayName: 'Get commit SHA'
|
||||
- script: |
|
||||
set /p __commit__=<$(Pipeline.Workspace)\__commit.txt
|
||||
git fetch origin +%__commit__%:refs/remotes/origin/%__commit__%
|
||||
git checkout --force %__commit__%
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
displayName: 'Read commit SHA and checkout'
|
||||
- script: |
|
||||
git submodule sync -- cmake\external\onnx
|
||||
git submodule update --init -- cmake\external\onnx
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
displayName: 'Checkout submodule onnx'
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '14.x'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'specific'
|
||||
project: 'onnxruntime'
|
||||
pipeline: 161
|
||||
preferTriggeringPipeline: true
|
||||
patterns: 'Release_*/**/*'
|
||||
path: $(Pipeline.Workspace)\artifacts
|
||||
displayName: 'Download WebAssembly artifacts'
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Pipeline.Workspace)\artifacts
|
||||
contents: |
|
||||
**\*.wasm
|
||||
targetFolder: $(Build.SourcesDirectory)\js\web\dist
|
||||
flattenFolders: true
|
||||
displayName: 'Binplace dist files'
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Pipeline.Workspace)\artifacts
|
||||
contents: |
|
||||
**\*.js
|
||||
targetFolder: $(Build.SourcesDirectory)\js\web\lib\wasm\binding
|
||||
flattenFolders: true
|
||||
displayName: 'Binplace js files'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js'
|
||||
displayName: 'npm ci /js/'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\common'
|
||||
displayName: 'npm ci /js/common/'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\web'
|
||||
displayName: 'npm ci /js/web/'
|
||||
- script: |
|
||||
npm test -- suite0 --wasm-init-timeout=30000 --file-cache
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\web'
|
||||
displayName: 'npm test (Suite0, Chrome)'
|
||||
- script: |
|
||||
npm test -- suite0 --env=firefox --wasm-init-timeout=30000 --file-cache
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\web'
|
||||
displayName: 'npm test (Suite0, Firefox)'
|
||||
- script: |
|
||||
npm test -- suite0 --env=edge --wasm-init-timeout=30000 --file-cache
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\web'
|
||||
displayName: 'npm test (Suite0, Edge)'
|
||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
Loading…
Reference in a new issue