| 1 |
@rem Copyright 2022 The gRPC Authors |
| 2 |
@rem |
| 3 |
@rem Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
@rem you may not use this file except in compliance with the License. |
| 5 |
@rem You may obtain a copy of the License at |
| 6 |
@rem |
| 7 |
@rem http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
@rem |
| 9 |
@rem Unless required by applicable law or agreed to in writing, software |
| 10 |
@rem distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
@rem See the License for the specific language governing permissions and |
| 13 |
@rem limitations under the License. |
| 14 |
|
| 15 |
@rem Avoid slow finalization after the script has exited. |
| 16 |
@rem See the script's prologue for info on the correct invocation pattern. |
| 17 |
setlocal EnableDelayedExpansion |
| 18 |
IF "%cd%"=="T:\src" ( |
| 19 |
call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0 |
| 20 |
echo respawn script has finished with exitcode !errorlevel! |
| 21 |
exit /b !errorlevel! |
| 22 |
) |
| 23 |
endlocal |
| 24 |
|
| 25 |
@rem enter repo root |
| 26 |
cd /d %~dp0\..\..\.. |
| 27 |
|
| 28 |
set PREPARE_BUILD_INSTALL_DEPS_CSHARP=true |
| 29 |
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1 |
| 30 |
|
| 31 |
call tools/internal_ci/helper_scripts/prepare_ccache.bat || exit /b 1 |
| 32 |
|
| 33 |
@rem Install Msys2 zip to avoid crash when using cygwin's zip on grpc-win2016 kokoro workers. |
| 34 |
@rem Downloading from GCS should be very reliables when on a GCP VM. |
| 35 |
@rem TODO(jtattermusch): find a better way of making the build_packages step work on windows workers. |
| 36 |
mkdir C:\zip |
| 37 |
curl -sSL --fail -o C:\zip\zip.exe https://storage.googleapis.com/grpc-build-helper/zip-3.0-1-x86_64/zip.exe || goto :error |
| 38 |
set PATH=C:\zip;%PATH% |
| 39 |
zip --version |
| 40 |
|
| 41 |
@rem Build all protoc windows artifacts |
| 42 |
python tools/run_tests/task_runner.py -f artifact windows protoc %TASK_RUNNER_EXTRA_FILTERS% -j 4 --inner_jobs 4 -x build_artifacts_protoc/sponge_log.xml || set FAILED=true |
| 43 |
|
| 44 |
@rem the next step expects to find the artifacts from the previous step in the "input_artifacts" folder. |
| 45 |
bash -c "rm -rf input_artifacts; mkdir -p input_artifacts; cp -r artifacts/* input_artifacts/ || true" |
| 46 |
|
| 47 |
@rem This step builds the nuget packages from input_artifacts |
| 48 |
@rem Set env variable option to build single platform version of the nugets. |
| 49 |
@rem (this is required as we only have the windows artifacts at hand) |
| 50 |
set GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET=1 |
| 51 |
python tools/run_tests/task_runner.py -f package windows csharp nuget -j 2 -x build_packages/sponge_log.xml || set FAILED=true |
| 52 |
|
| 53 |
@rem the next step expects to find the artifacts from the previous step in the "input_artifacts" folder. |
| 54 |
@rem in addition to that, preserve the contents of "artifacts" directory since we want kokoro |
| 55 |
@rem to upload its contents as job output artifacts |
| 56 |
bash -c "rm -rf input_artifacts; mkdir -p input_artifacts; cp -r artifacts/* input_artifacts/ || true" |
| 57 |
|
| 58 |
@rem Run all C# windows distribtests |
| 59 |
@rem We run the distribtests even if some of the artifacts have failed to build, since that gives |
| 60 |
@rem a better signal about which distribtest are affected by the currently broken artifact builds. |
| 61 |
python tools/run_tests/task_runner.py -f distribtest windows csharp %TASK_RUNNER_EXTRA_FILTERS% -j 4 -x distribtests/sponge_log.xml || set FAILED=true |
| 62 |
|
| 63 |
@rem show ccache stats |
| 64 |
ccache --show-stats |
| 65 |
|
| 66 |
bash tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh |
| 67 |
|
| 68 |
if not "%FAILED%" == "" ( |
| 69 |
exit /b 1 |
| 70 |
) |