Skip to content

Commit 548d69c

Browse files
add --use_cache on win flows
1 parent 8b46106 commit 548d69c

13 files changed

Lines changed: 348 additions & 63 deletions

.github/workflows/windows_build_x64_asan.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,18 @@ jobs:
4040
cache_key: windows_build_x64_asan.yml | build_x64
4141

4242
- name: Build and Test (Combined)
43-
shell: cmd
43+
shell: pwsh
4444
run: |
45-
@echo off
46-
echo %PATH%
47-
python -m pip install -r "%GITHUB_WORKSPACE%\tools\ci_build/github/windows\python\requirements.txt"
48-
python "%GITHUB_WORKSPACE%\tools\ci_build\build.py" --config Debug --build_dir "%RUNNER_TEMP%\build" --skip_submodule_sync --parallel --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_generator "Visual Studio 17 2022" --disable_memleak_checker --enable_address_sanitizer
45+
echo ${env:PATH}
46+
python -m pip install -r "${env:GITHUB_WORKSPACE}\tools\ci_build\github\windows\python\requirements.txt"
47+
python "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" `
48+
--build_dir "${env:RUNNER_TEMP}\build" `
49+
--cmake_generator "Ninja" `
50+
--config Debug `
51+
--disable_memleak_checker `
52+
--enable_address_sanitizer `
53+
--parallel `
54+
--skip_submodule_sync `
55+
--use_cache `
56+
--use_vcpkg `
57+
--use_vcpkg_ms_internal_asset_cache

.github/workflows/windows_cuda.yml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,42 @@ jobs:
110110
111111
- name: Build and Clean Binaries
112112
working-directory: ${{ runner.temp }}
113+
shell: pwsh
113114
run: |
114115
npm install -g typescript
115116
if ($lastExitCode -ne 0) {
116117
exit $lastExitCode
117118
}
118119
# Execute the build process
119-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
120+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
121+
--build `
122+
--build_csharp `
123+
--build_dir build `
124+
--build_java `
125+
--build_shared_lib `
126+
--build_wheel `
127+
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 `
128+
--cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON `
129+
--cmake_generator "Ninja" `
130+
--config RelWithDebInfo `
131+
--cuda_home="$env:RUNNER_TEMP\v12.8" `
132+
--enable_cuda_profiling `
133+
--enable_transformers_tool_test `
134+
--nvcc_threads 1 `
135+
--parallel `
136+
--skip_submodule_sync `
137+
--update `
138+
--use_binskim_compliant_compile_flags `
139+
--use_cache `
140+
--use_cuda `
141+
--use_vcpkg `
142+
--use_vcpkg_ms_internal_asset_cache
120143
if ($lastExitCode -ne 0) {
121144
exit $lastExitCode
122145
}
123146
124147
# Clean up the output directory before uploading artifacts
125-
$outputDir = "${{ runner.temp }}\build\RelWithDebInfo"
148+
$outputDir = "$env:RUNNER_TEMP\build\RelWithDebInfo"
126149
Write-Host "Cleaning up files from $outputDir..."
127150
128151
Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue
@@ -134,7 +157,6 @@ jobs:
134157
Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue
135158
# Remove intermediate object files as in the original script
136159
Remove-Item -Path $outputDir -Include "*.obj" -Recurse
137-
shell: pwsh
138160
139161
- name: Upload build artifacts
140162
uses: actions/upload-artifact@v6
@@ -225,23 +247,44 @@ jobs:
225247
whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist
226248

227249
- name: Run Tests
250+
shell: pwsh
228251
working-directory: ${{ runner.temp }}
229252
run: |
230253
npm install -g typescript
231254
if ($lastExitCode -ne 0) {
232255
exit $lastExitCode
233256
}
234257
235-
python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo"
258+
python.exe ${env:GITHUB_WORKSPACE}\tools\python\update_ctest_path.py "${env:RUNNER_TEMP}\build\RelWithDebInfo\CTestTestfile.cmake" "${env:RUNNER_TEMP}\build\RelWithDebInfo"
236259
if ($lastExitCode -ne 0) {
237260
exit $lastExitCode
238261
}
239262
240-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --test --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.8" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
263+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
264+
--build_csharp `
265+
--build_dir build `
266+
--build_java `
267+
--build_shared_lib `
268+
--build_wheel `
269+
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 `
270+
--cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON `
271+
--cmake_generator "Ninja" `
272+
--config RelWithDebInfo `
273+
--cuda_home "${env:RUNNER_TEMP}\v12.8" `
274+
--enable_cuda_profiling `
275+
--enable_transformers_tool_test `
276+
--nvcc_threads 1 `
277+
--parallel `
278+
--skip_submodule_sync `
279+
--test `
280+
--use_binskim_compliant_compile_flags `
281+
--use_cache `
282+
--use_cuda `
283+
--use_vcpkg `
284+
--use_vcpkg_ms_internal_asset_cache
241285
if ($lastExitCode -ne 0) {
242286
exit $lastExitCode
243287
}
244-
shell: pwsh
245288
246289
- name: Validate C# native delegates
247290
run: python tools\ValidateNativeDelegateAttributes.py

.github/workflows/windows_dml.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,29 @@ jobs:
9494
echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV
9595
9696
- name: Build and Test
97+
shell: pwsh
9798
working-directory: ${{ runner.temp }}
9899
run: |
99-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --skip_onnx_tests --build_wheel --use_dml --enable_wcos --use_vcpkg --use_vcpkg_ms_internal_asset_cache
100+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
101+
--build_csharp `
102+
--build_dir build `
103+
--build_shared_lib `
104+
--build_wheel `
105+
--cmake_generator "Ninja" `
106+
--config RelWithDebInfo `
107+
--enable_wcos `
108+
--parallel `
109+
--skip_onnx_tests `
110+
--skip_submodule_sync `
111+
--use_binskim_compliant_compile_flags `
112+
--use_cache `
113+
--use_dml `
114+
--use_vcpkg `
115+
--use_vcpkg_ms_internal_asset_cache
100116
if ($lastExitCode -ne 0) {
101117
exit $lastExitCode
102118
}
103-
Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse
104-
shell: pwsh
119+
Remove-Item "${env:GITHUB_WORKSPACE}\RelWithDebInfo" -Include "*.obj" -Recurse
105120
106121
- name: Validate C# native delegates
107122
run: python tools\ValidateNativeDelegateAttributes.py

.github/workflows/windows_openvino.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,51 @@ jobs:
145145
146146
- name: Generate onnxruntime.sln
147147
shell: pwsh
148+
env:
149+
build_cfg: ${{ env.BuildConfig }}
148150
working-directory: ${{ runner.temp }}
149151
run: |
150-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config ${{ env.BuildConfig }} --build_dir build --cmake_generator "Visual Studio 17 2022" --build_shared_lib --use_openvino CPU --use_binskim_compliant_compile_flags --update --parallel
152+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
153+
--build_dir build `
154+
--build_shared_lib `
155+
--cmake_generator "Ninja" `
156+
--config ${env:build_cfg} `
157+
--parallel `
158+
--update `
159+
--use_binskim_compliant_compile_flags `
160+
--use_cache `
161+
--use_openvino CPU
151162
152163
- name: Build
153164
shell: pwsh
165+
env:
166+
build_cfg: ${{ env.BuildConfig }}
154167
working-directory: ${{ runner.temp }}
155168
run: |
156-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config ${{ env.BuildConfig }} --build_dir build --cmake_generator "Visual Studio 17 2022" --build_shared_lib --use_openvino CPU --use_binskim_compliant_compile_flags --build --parallel
157-
169+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
170+
--build `
171+
--build_dir build `
172+
--build_shared_lib `
173+
--cmake_generator "Ninja" `
174+
--config ${env:build_cfg} `
175+
--parallel `
176+
--use_binskim_compliant_compile_flags `
177+
--use_cache `
178+
--use_openvino CPU
158179
159180
- name: Run unit tests
160181
shell: pwsh
182+
env:
183+
build_cfg: ${{ env.BuildConfig }}
161184
working-directory: ${{ runner.temp }}
162185
run: |
163-
python "${{ github.workspace }}\tools\ci_build\build.py" `
164-
--config "${{ env.BuildConfig }}" `
186+
python "${env:GITHUB_WORKSPACE}\tools\ci_build\build.py" `
165187
--build_dir build `
166-
--cmake_generator "Visual Studio 17 2022" `
167188
--build_shared_lib `
168-
--use_openvino CPU `
189+
--cmake_generator "Ninja" `
190+
--config "${env:build_cfg}" `
191+
--enable_onnx_tests `
192+
--test `
169193
--use_binskim_compliant_compile_flags `
170-
--test --enable_onnx_tests
194+
--use_cache `
195+
--use_openvino CPU

.github/workflows/windows_qnn_x64.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,25 @@ jobs:
6565
dir $qnn_sdk_path
6666
6767
- name: Build and Test
68-
shell: cmd
68+
shell: pwsh
69+
env:
70+
qnn_kind: ${{ matrix.QnnLibKind }}
6971
run: |
70-
python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir ${{ runner.temp }}\build --cmake_generator "Visual Studio 17 2022" --build_java --build_shared_lib --use_qnn ${{ matrix.QnnLibKind }} --qnn_home %QNN_SDK_ROOT% --use_binskim_compliant_compile_flags --update --build --test --enable_onnx_tests --parallel
72+
python.exe ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
73+
--build `
74+
--build_dir "${env:RUNNER_TEMP}\build" `
75+
--build_java `
76+
--build_shared_lib `
77+
--cmake_generator "Ninja" `
78+
--config RelWithDebInfo `
79+
--enable_onnx_tests `
80+
--parallel `
81+
--qnn_home "${env:QNN_SDK_ROOT}" `
82+
--test `
83+
--update `
84+
--use_binskim_compliant_compile_flags `
85+
--use_cache `
86+
--use_qnn ${env:qnn_kind}
7187
7288
- name: Run ONNX Tests
7389
shell: cmd

.github/workflows/windows_tensorrt.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,38 @@ jobs:
116116
117117
- name: Build and Clean Binaries
118118
working-directory: ${{ runner.temp }}
119+
shell: pwsh
119120
run: |
120121
npm install -g typescript
121122
if ($lastExitCode -ne 0) {
122123
exit $lastExitCode
123124
}
124125
# Execute the build process
125-
python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --parallel --nvcc_threads 1 --use_binskim_compliant_compile_flags --build_dir build --skip_submodule_sync --build_shared_lib --build --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" --cuda_home="${{ runner.temp }}\v12.8" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
126+
python ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
127+
--build `
128+
--build_dir "${env:RUNNER_TEMP}\build" `
129+
--build_shared_lib `
130+
--build_wheel `
131+
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 `
132+
--cmake_generator "Ninja" `
133+
--config RelWithDebInfo `
134+
--cuda_home "${env:RUNNER_TEMP}\v12.8" `
135+
--enable_onnx_tests `
136+
--nvcc_threads 1 `
137+
--parallel `
138+
--skip_submodule_sync `
139+
--tensorrt_home "${env:RUNNER_TEMP}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" `
140+
--update `
141+
--use_binskim_compliant_compile_flags `
142+
--use_tensorrt `
143+
--use_vcpkg `
144+
--use_vcpkg_ms_internal_asset_cache
126145
if ($lastExitCode -ne 0) {
127146
exit $lastExitCode
128147
}
129148
130149
# Clean up the output directory before uploading artifacts
131-
$outputDir = "${{ runner.temp }}\build\RelWithDebInfo"
150+
$outputDir = "${env:RUNNER_TEMP}\build\RelWithDebInfo"
132151
Write-Host "Cleaning up files from $outputDir..."
133152
134153
Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue
@@ -140,7 +159,6 @@ jobs:
140159
Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue
141160
# Remove intermediate object files as in the original script
142161
Remove-Item -Path $outputDir -Include "*.obj" -Recurse
143-
shell: pwsh
144162
145163
- name: Upload build artifacts
146164
uses: actions/upload-artifact@v6
@@ -238,22 +256,40 @@ jobs:
238256

239257
- name: Run Tests
240258
working-directory: ${{ runner.temp }}
259+
shell: pwsh
241260
run: |
242261
npm install -g typescript
243262
if ($lastExitCode -ne 0) {
244263
exit $lastExitCode
245264
}
246265
247-
python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo"
266+
python.exe ${env:GITHUB_WORKSPACE}\tools\python\update_ctest_path.py "${env:RUNNER_TEMP}\build\RelWithDebInfo\CTestTestfile.cmake" "${env:RUNNER_TEMP}\build\RelWithDebInfo"
248267
if ($lastExitCode -ne 0) {
249268
exit $lastExitCode
250269
}
251270
252-
python ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --use_binskim_compliant_compile_flags --parallel --nvcc_threads 1 --build_dir build --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="${{ runner.temp }}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" --cuda_home="${{ runner.temp }}\v12.8" --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
271+
python ${env:GITHUB_WORKSPACE}\tools\ci_build\build.py `
272+
--build_dir build `
273+
--build_shared_lib `
274+
--build_wheel `
275+
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
276+
--cmake_generator "Ninja" `
277+
--config RelWithDebInfo `
278+
--cuda_home "${env:RUNNER_TEMP}\v12.8" `
279+
--enable_onnx_tests `
280+
--nvcc_threads 1 `
281+
--parallel `
282+
--skip_submodule_sync `
283+
--tensorrt_home "${env:RUNNER_TEMP}\TensorRT-10.14.1.48.Windows.win10.cuda-12.9" `
284+
--test `
285+
--use_binskim_compliant_compile_flags `
286+
--use_cache `
287+
--use_tensorrt `
288+
--use_vcpkg `
289+
--use_vcpkg_ms_internal_asset_cache `
253290
if ($lastExitCode -ne 0) {
254291
exit $lastExitCode
255292
}
256-
shell: pwsh
257293
258294
- name: Validate C# native delegates
259295
run: python tools\ValidateNativeDelegateAttributes.py

0 commit comments

Comments
 (0)