@@ -45,21 +45,22 @@ jobs:
4545 env :
4646 buildArch : x64
4747 common_build_args : >-
48- --parallel
49- --use_cache
50- ${{ inputs.use_vcpkg == true && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }}
51- --config ${{ inputs.build_config }}
52- --skip_submodule_sync
5348 --build_wasm
49+ --config '${{ inputs.build_config }}'
5450 --enable_wasm_simd
51+ --parallel
52+ --skip_submodule_sync
53+ --use_cache
5554 ${{ inputs.enable_wasm_threads == true && '--enable_wasm_threads' || '' }}
55+ ${{ inputs.use_vcpkg == true && '--use_vcpkg --use_vcpkg_ms_internal_asset_cache' || '' }}
5656 ${{ inputs.extra_build_args }}
57+
5758 reduced_size_build_args : >-
58- --disable_ml_ops
5959 --disable_generation_ops
60+ --disable_ml_ops
6061 --disable_types string float4 float8 optional sparsetensor
61- --include_ops_by_config onnxruntime/wasm/reduced_types.config
6262 --enable_reduced_operator_type_support
63+ --include_ops_by_config onnxruntime/wasm/reduced_types.config
6364
6465 steps :
6566 - name : Checkout code
@@ -106,20 +107,24 @@ jobs:
106107 disable-terrapin : ' true'
107108
108109 - name : Build (simd + threads)
110+ shell : bash
109111 run : |
112+ set -euo pipefail
110113 python ./tools/ci_build/build.py \
111114 ${{ env.common_build_args }} \
112- --build_dir ${{ github.workspace }} /build/wasm_inferencing \
115+ --build_dir "${GITHUB_WORKSPACE} /build/wasm_inferencing" \
113116 ${{ inputs.build_config == 'Release' && '--enable_wasm_api_exception_catching' || '' }} \
114117 --skip_tests
115118 working-directory : ${{ github.workspace }}
116119
117120 - name : Build (simd + threads + JSEP)
118121 if : ${{ inputs.build_jsep == true }}
122+ shell : bash
119123 run : |
124+ set -euo pipefail
120125 python ./tools/ci_build/build.py \
121126 ${{ env.common_build_args }} \
122- --build_dir ${{ github.workspace }} /build/wasm_inferencing_jsep \
127+ --build_dir "${GITHUB_WORKSPACE} /build/wasm_inferencing_jsep" \
123128 --use_jsep \
124129 --use_webnn \
125130 --target onnxruntime_webassembly \
@@ -129,10 +134,12 @@ jobs:
129134
130135 - name : Build (simd + threads + WebGPU experimental)
131136 if : ${{ inputs.build_webgpu == true }}
137+ shell : bash
132138 run : |
139+ set -euo pipefail
133140 python ./tools/ci_build/build.py \
134141 ${{ env.common_build_args }} \
135- --build_dir ${{ github.workspace }} /build/wasm_inferencing_webgpu \
142+ --build_dir "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu" \
136143 --use_webgpu \
137144 --use_webnn \
138145 --target onnxruntime_webassembly \
@@ -143,10 +150,12 @@ jobs:
143150
144151 - name : Build (simd + threads + WebGPU experimental, JSPI)
145152 if : ${{ inputs.build_webgpu == true }}
153+ shell : bash
146154 run : |
155+ set -euo pipefail
147156 python ./tools/ci_build/build.py \
148157 ${{ env.common_build_args }} \
149- --build_dir ${{ github.workspace }} /build/wasm_inferencing_webgpu_jspi \
158+ --build_dir "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu_jspi" \
150159 --use_webgpu \
151160 --use_webnn \
152161 --enable_wasm_jspi \
@@ -157,21 +166,25 @@ jobs:
157166
158167 - name : Create Artifacts
159168 if : ${{ inputs.skip_publish != true }}
169+ shell : bash
170+ env :
171+ build_cfg : ${{ inputs.build_config }}
160172 run : |
161- mkdir -p ${{ github.workspace }}/artifacts/wasm/
162- cp ${{ github.workspace }}/build/wasm_inferencing/${{ inputs.build_config }}/ort-wasm-simd-threaded.wasm ${{ github.workspace }}/artifacts/wasm/
163- cp ${{ github.workspace }}/build/wasm_inferencing/${{ inputs.build_config }}/ort-wasm-simd-threaded.mjs ${{ github.workspace }}/artifacts/wasm/
164- if [ -d ${{ github.workspace }}/build/wasm_inferencing_jsep ]; then
165- cp ${{ github.workspace }}/build/wasm_inferencing_jsep/${{ inputs.build_config }}/ort-wasm-simd-threaded.jsep.wasm ${{ github.workspace }}/artifacts/wasm/
166- cp ${{ github.workspace }}/build/wasm_inferencing_jsep/${{ inputs.build_config }}/ort-wasm-simd-threaded.jsep.mjs ${{ github.workspace }}/artifacts/wasm/
173+ set -euo pipefail
174+ mkdir -p "${GITHUB_WORKSPACE}/artifacts/wasm/"
175+ cp "${GITHUB_WORKSPACE}/build/wasm_inferencing/${build_cfg}/ort-wasm-simd-threaded.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/"
176+ cp "${GITHUB_WORKSPACE}/build/wasm_inferencing/${build_cfg}/ort-wasm-simd-threaded.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/"
177+ if [ -d "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep" ]; then
178+ cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep/${build_cfg}/ort-wasm-simd-threaded.jsep.wasm" "${GITHUB_WORKSPACE}/artifacts/wasm/"
179+ cp "${GITHUB_WORKSPACE}/build/wasm_inferencing_jsep/${build_cfg}/ort-wasm-simd-threaded.jsep.mjs" "${GITHUB_WORKSPACE}/artifacts/wasm/"
167180 fi
168- if [ -d ${{ github.workspace }} /build/wasm_inferencing_webgpu ]; then
169- cp ${{ github.workspace }} /build/wasm_inferencing_webgpu/${{ inputs.build_config }} /ort-wasm-simd-threaded.asyncify.wasm ${{ github.workspace }} /artifacts/wasm/
170- cp ${{ github.workspace }} /build/wasm_inferencing_webgpu/${{ inputs.build_config }} /ort-wasm-simd-threaded.asyncify.mjs ${{ github.workspace }} /artifacts/wasm/
181+ if [ -d "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu" ]; then
182+ cp "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu/${build_cfg} /ort-wasm-simd-threaded.asyncify.wasm" "${GITHUB_WORKSPACE} /artifacts/wasm/"
183+ cp "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu/${build_cfg} /ort-wasm-simd-threaded.asyncify.mjs" "${GITHUB_WORKSPACE} /artifacts/wasm/"
171184 fi
172- if [ -d ${{ github.workspace }} /build/wasm_inferencing_webgpu_jspi ]; then
173- cp ${{ github.workspace }} /build/wasm_inferencing_webgpu_jspi/${{ inputs.build_config }} /ort-wasm-simd-threaded.jspi.wasm ${{ github.workspace }} /artifacts/wasm/
174- cp ${{ github.workspace }} /build/wasm_inferencing_webgpu_jspi/${{ inputs.build_config }} /ort-wasm-simd-threaded.jspi.mjs ${{ github.workspace }} /artifacts/wasm/
185+ if [ -d "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu_jspi" ]; then
186+ cp "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu_jspi/${build_cfg} /ort-wasm-simd-threaded.jspi.wasm" "${GITHUB_WORKSPACE} /artifacts/wasm/"
187+ cp "${GITHUB_WORKSPACE} /build/wasm_inferencing_webgpu_jspi/${build_cfg} /ort-wasm-simd-threaded.jspi.mjs" "${GITHUB_WORKSPACE} /artifacts/wasm/"
175188 fi
176189
177190 - name : Upload WASM artifacts
@@ -184,20 +197,24 @@ jobs:
184197 - name : Test (Node.js) (simd + threads)
185198 # unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds.
186199 if : ${{ inputs.build_config == 'Debug' }}
200+ shell : bash
187201 run : |
202+ set -euo pipefail
188203 python ./tools/ci_build/build.py \
189204 ${{ env.common_build_args }} \
190- --build_dir ${{ github.workspace }}/ build/wasm_inferencing \
205+ --build_dir build/wasm_inferencing \
191206 --test
192207 working-directory : ${{ github.workspace }}
193208
194209 - name : Test (browser) (simd + threads)
195210 # unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds.
196211 if : ${{ inputs.build_config == 'Debug' }}
212+ shell : bash
197213 run : |
214+ set -euo pipefail
198215 python ./tools/ci_build/build.py \
199216 ${{ env.common_build_args }} \
200- --build_dir ${{ github.workspace }}/ build/wasm_inferencing \
217+ --build_dir build/wasm_inferencing \
201218 --wasm_run_tests_in_browser \
202219 --targets onnxruntime_test_all onnxruntime_provider_test \
203220 --update --build --test
0 commit comments