@@ -316,8 +316,8 @@ jobs:
316316 # for Apple Silicon to detect issues there.
317317 bazel : build --cpu=darwin_arm64 //src/...
318318 - name : Windows
319- os : windows-2019
320- cache_key : windows-2019
319+ os : windows-2022
320+ cache_key : windows-2022
321321 bazel : test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
322322 name : ${{ matrix.name }} Bazel
323323 runs-on : ${{ matrix.os }}
@@ -342,39 +342,41 @@ jobs:
342342 os : macos-12
343343 flags : -DCMAKE_CXX_STANDARD=14
344344 - name : Windows CMake
345- os : windows-2019
345+ os : windows-2022
346346 flags : >-
347347 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
348348 -Dprotobuf_BUILD_SHARED_LIBS=OFF
349349 -Dprotobuf_BUILD_EXAMPLES=ON
350- vsversion : ' 2019 '
351- - name : Windows CMake 2022
352- os : windows-2022
350+ vsversion : ' 2022 '
351+ - name : Windows CMake 2019
352+ os : windows-2019
353353 flags : >-
354354 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
355355 -Dprotobuf_BUILD_SHARED_LIBS=OFF
356356 -Dprotobuf_BUILD_EXAMPLES=ON
357- vsversion : ' 2022'
357+ vsversion : ' 2019'
358+ # windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
359+ python-version : ' 3.8'
358360 - name : Windows CMake 32-bit
359- os : windows-2019
361+ os : windows-2022
360362 flags : >-
361363 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
362- vsversion : ' 2019 '
364+ vsversion : ' 2022 '
363365 windows-arch : ' win32'
364366 - name : Windows CMake Shared
365- os : windows-2019
367+ os : windows-2022
366368 flags : >-
367369 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
368370 -Dprotobuf_BUILD_SHARED_LIBS=ON
369- vsversion : ' 2019 '
371+ vsversion : ' 2022 '
370372 - name : Windows CMake Install
371- os : windows-2019
373+ os : windows-2022
372374 install-flags : -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
373375 flags : >-
374376 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
375377 -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
376378 -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
377- vsversion : ' 2019 '
379+ vsversion : ' 2022 '
378380 name : ${{ matrix.name }}
379381 runs-on : ${{ matrix.os }}
380382 steps :
@@ -384,6 +386,17 @@ jobs:
384386 ref : ${{ inputs.safe-checkout }}
385387 submodules : recursive
386388
389+ # Workaround for incompatibility between gcloud and windows-2019 runners.
390+ - name : Install Python
391+ if : ${{ matrix.python-version }}
392+ uses : actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
393+ with :
394+ python-version : ${{ matrix.python-version }}
395+ - name : Use custom python for gcloud
396+ if : ${{ matrix.python-version }}
397+ run : echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
398+ shell : bash
399+
387400 - name : Setup ccache
388401 uses : protocolbuffers/protobuf-ci/ccache@v2
389402 with :
0 commit comments