mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-16 21:00:14 +00:00
[js/web] Integrate ONNX Runtime Web CI with BrowserStack (#8859)
* Integrate ONNX Runtime Web CI with BrowserStack * Rename a pipeline from browserstack to multi-platform
This commit is contained in:
parent
757e9e6df7
commit
332c2ba4f4
1 changed files with 185 additions and 0 deletions
|
|
@ -0,0 +1,185 @@
|
|||
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