Fix windows 2019 build.

setup-gcloud doesn't honor the environment variables set by setup-python, so we need to manually set CLOUDSDK_PYTHON before running it.

PiperOrigin-RevId: 578674246
pull/14599/head
Mike Kruskal 1 year ago committed by Copybara-Service
parent b4c9546467
commit 769ab10e3b
  1. 19
      .github/workflows/test_cpp.yml

@ -366,6 +366,7 @@ jobs:
-Dprotobuf_BUILD_EXAMPLES=ON
vsversion: '2019'
cache-prefix: windows-2019-cmake
# windows-2019 has python3.7 installed, which is incompatible with the latest gcloud
python-version: '3.8'
- name: Windows CMake 32-bit
os: windows-2022
@ -399,13 +400,6 @@ jobs:
ref: ${{ inputs.safe-checkout }}
submodules: recursive
- name: Install Python
if: ${{ matrix.python-version }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Setup MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1
@ -413,6 +407,17 @@ jobs:
arch: ${{ matrix.windows-arch || 'x64' }}
vsversion: ${{ matrix.vsversion }}
# Workaround for incompatibility between gcloud and windows-2019 runners.
- name: Install Python
if: ${{ matrix.python-version }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Use custom python for gcloud
if: ${{ matrix.python-version }}
run: echo "CLOUDSDK_PYTHON=${Python3_ROOT_DIR}\\python3" >> $GITHUB_ENV
shell: bash
- name: Setup sccache
uses: protocolbuffers/protobuf-ci/sccache@v2
with:

Loading…
Cancel
Save