@@ -324,8 +324,8 @@ jobs:
324324 # for Apple Silicon to detect issues there.
325325 bazel : build --cpu=darwin_arm64 //src/...
326326 - name : Windows
327- os : windows-2019
328- cache_key : windows-2019
327+ os : windows-2022
328+ cache_key : windows-2022
329329 bazel : test //src/... @com_google_protobuf_examples//... --test_tag_filters=-conformance --build_tag_filters=-conformance
330330 name : ${{ matrix.name }} Bazel
331331 runs-on : ${{ matrix.os }}
@@ -351,44 +351,46 @@ jobs:
351351 flags : -DCMAKE_CXX_STANDARD=14
352352 cache-prefix : macos-cmake
353353 - name : Windows CMake
354- os : windows-2019
355- flags : >-
356- -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
357- -Dprotobuf_BUILD_SHARED_LIBS=OFF
358- -Dprotobuf_BUILD_EXAMPLES=ON
359- vsversion : ' 2019'
360- cache-prefix : windows-2019-cmake
361- - name : Windows CMake 2022
362354 os : windows-2022
363355 flags : >-
364356 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
365357 -Dprotobuf_BUILD_SHARED_LIBS=OFF
366358 -Dprotobuf_BUILD_EXAMPLES=ON
367359 vsversion : ' 2022'
368360 cache-prefix : windows-2022-cmake
369- - name : Windows CMake 32-bit
361+ - name : Windows CMake 2019
370362 os : windows-2019
371363 flags : >-
372364 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
365+ -Dprotobuf_BUILD_SHARED_LIBS=OFF
366+ -Dprotobuf_BUILD_EXAMPLES=ON
373367 vsversion : ' 2019'
368+ cache-prefix : windows-2019-cmake
369+ # windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
370+ python-version : ' 3.8'
371+ - name : Windows CMake 32-bit
372+ os : windows-2022
373+ flags : >-
374+ -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
375+ vsversion : ' 2022'
374376 windows-arch : ' win32'
375- cache-prefix : windows-2019 -win32-cmake
377+ cache-prefix : windows-2022 -win32-cmake
376378 - name : Windows CMake Shared
377- os : windows-2019
379+ os : windows-2022
378380 flags : >-
379381 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
380382 -Dprotobuf_BUILD_SHARED_LIBS=ON
381- vsversion : ' 2019 '
382- cache-prefix : windows-2019 -cmake
383+ vsversion : ' 2022 '
384+ cache-prefix : windows-2022 -cmake
383385 - name : Windows CMake Install
384- os : windows-2019
386+ os : windows-2022
385387 install-flags : -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_TESTS=OFF
386388 flags : >-
387389 -G Ninja -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF
388390 -Dprotobuf_REMOVE_INSTALLED_HEADERS=ON
389391 -Dprotobuf_BUILD_PROTOBUF_BINARIES=OFF
390- vsversion : ' 2019 '
391- cache-prefix : windows-2019 -cmake
392+ vsversion : ' 2022 '
393+ cache-prefix : windows-2022 -cmake
392394 name : ${{ matrix.name }}
393395 runs-on : ${{ matrix.os }}
394396 steps :
@@ -405,6 +407,17 @@ jobs:
405407 arch : ${{ matrix.windows-arch || 'x64' }}
406408 vsversion : ${{ matrix.vsversion }}
407409
410+ # Workaround for incompatibility between gcloud and windows-2019 runners.
411+ - name : Install Python
412+ if : ${{ matrix.python-version }}
413+ uses : actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
414+ with :
415+ python-version : ${{ matrix.python-version }}
416+ - name : Use custom python for gcloud
417+ if : ${{ matrix.python-version }}
418+ run : echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
419+ shell : bash
420+
408421 - name : Setup sccache
409422 uses : protocolbuffers/protobuf-ci/sccache@v2
410423 with :
0 commit comments