diff --git a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml index 8456ee42d2190..2edc357c905c1 100644 --- a/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/linux-wasm-ci.yml @@ -45,9 +45,21 @@ jobs: name: ${{ parameters.PoolName }} variables: buildArch: x64 + # command line arguments for all builds CommonBuildArgs: '--parallel --config ${{ parameters.BuildConfig }} --skip_submodule_sync --build_wasm --use_extensions --cmake_extra_defines onnxruntime_WEBASSEMBLY_DEFAULT_EXTENSION_FLAGS=ON ${{ parameters.ExtraBuildArgs }}' - NonJsepBuildArgs: '--use_webnn --target onnxruntime_webassembly --skip_tests' - JsepBuildArgs: '--use_jsep --use_webnn --target onnxruntime_webassembly --skip_tests' + # command line arguments for non-JSEP builds + NonJsepCommonBuildArgs: '--enable_wasm_native_eh' + # command line arguments for JSEP builds + JsepCommonBuildArgs: '--use_jsep --use_webnn' + + ${{ if eq(parameters.BuildConfig, 'Debug') }}: + # Debug build + NonJsepBuildArgs: '$(NonJsepCommonBuildArgs)' + JsepBuildArgs: '$(JsepCommonBuildArgs)' + ${{ else }}: + # Release build + NonJsepBuildArgs: '$(NonJsepCommonBuildArgs)' + JsepBuildArgs: '$(JsepCommonBuildArgs) --target onnxruntime_webassembly --skip_tests --enable_wasm_api_exception_catching' runCodesignValidationInjection: false TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] ORT_CACHE_DIR: $(Agent.TempDirectory)/ort_ccache @@ -117,7 +129,7 @@ jobs: ${{ else }}: AdditionalKey: wasm | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm' + Arguments: '$(CommonBuildArgs) $(NonJsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm' DisplayName: 'Build and test (node)' WithCache: ${{ parameters.WithCache }} @@ -129,7 +141,7 @@ jobs: ${{ else }}: AdditionalKey: wasm_threads | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm_threads - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_threads --enable_wasm_threads' + Arguments: '$(CommonBuildArgs) $(NonJsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_threads --enable_wasm_threads' DisplayName: 'Build and test (node) (threads)' WithCache: ${{ parameters.WithCache }} @@ -141,7 +153,7 @@ jobs: ${{ else }}: AdditionalKey: wasm_simd_threads | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm_simd_threads - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads --enable_wasm_simd --enable_wasm_threads --wasm_run_tests_in_browser' + Arguments: '$(CommonBuildArgs) $(NonJsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads --enable_wasm_simd --enable_wasm_threads --wasm_run_tests_in_browser' DisplayName: 'Build and test (browser) (simd + threads)' WithCache: ${{ parameters.WithCache }} @@ -153,7 +165,7 @@ jobs: ${{ else }}: AdditionalKey: wasm_simd | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm_simd - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd --enable_wasm_simd' + Arguments: '$(CommonBuildArgs) $(NonJsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd --enable_wasm_simd' DisplayName: 'Build and test (node) (simd)' WithCache: ${{ parameters.WithCache }} @@ -166,7 +178,7 @@ jobs: ${{ else }}: AdditionalKey: training_wasm_simd | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/training_wasm_simd - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/training_wasm_simd --enable_training_apis --enable_wasm_simd --target onnxruntime_webassembly --skip_tests' + Arguments: '$(CommonBuildArgs) $(NonJsepBuildArgs) --build_dir $(Build.BinariesDirectory)/training_wasm_simd --enable_training_apis --enable_wasm_simd --target onnxruntime_webassembly --skip_tests' DisplayName: 'Build (training + simd)' WithCache: ${{ parameters.WithCache }} @@ -179,7 +191,7 @@ jobs: ${{ else }}: AdditionalKey: wasm_simd_jsep | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm_simd_jsep - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_jsep --enable_wasm_simd $(JsepBuildArgs)' + Arguments: '$(CommonBuildArgs) $(JsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_jsep --enable_wasm_simd' DisplayName: 'Build (simd + JSEP)' WithCache: ${{ parameters.WithCache }} - template: build-linux-wasm-step.yml @@ -190,7 +202,7 @@ jobs: ${{ else }}: AdditionalKey: wasm_simd_threads_jsep | ${{ parameters.BuildConfig }} CacheDir: $(ORT_CACHE_DIR)/wasm_simd_threads_jsep - Arguments: '$(CommonBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads_jsep --enable_wasm_simd --enable_wasm_threads $(JsepBuildArgs)' + Arguments: '$(CommonBuildArgs) $(JsepBuildArgs) --build_dir $(Build.BinariesDirectory)/wasm_simd_threads_jsep --enable_wasm_simd --enable_wasm_threads' DisplayName: 'Build (simd + threads + JSEP)' WithCache: ${{ parameters.WithCache }}