fix: brew install cmake fix #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows-Builds | |
| # on: | |
| # workflow_call: | |
| # inputs: | |
| # checkout-ref: | |
| # required: true | |
| # description: "The ref we want to compile" | |
| # type: string | |
| # full-matrix: | |
| # required: true | |
| # description: "Build the full matrix" | |
| # type: boolean | |
| # sccache-mode: | |
| # required: true | |
| # description: "READ_WRITE or DISABLED" | |
| # type: string | |
| # vcpkg-cache-mode: | |
| # required: true | |
| # description: "read or readwrite" | |
| # type: string | |
| # execute-integration-tests: | |
| # required: true | |
| # description: "Integration tests require credentials." | |
| # type: boolean | |
| permissions: | |
| contents: read | |
| jobs: | |
| cmake: | |
| name: cmake + ${{ matrix.msvc }} + ${{ matrix.arch }} + ${{ matrix.build_type }} + ${{ matrix.shard }} | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: 'read' | |
| strategy: | |
| # Continue other builds even if one fails | |
| fail-fast: false | |
| matrix: | |
| exclude-from-full-trick: [ true ] | |
| msvc: [ msvc-2022 ] | |
| build_type: [ Release ] | |
| arch: [ x64 ] | |
| shard: [ Core3, Core4 ] | |
| exclude: | |
| # Also skip shards (Compute and Other) that contain only generated code. | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Compute | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: AIPlatform | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Shard1 | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Shard2 | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Shard3 | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Shard4 | |
| - exclude-from-full-trick: ${{ ! inputs.full-matrix }} | |
| shard: Other | |
| # No need to duplicate testing with x86 mode and Debug mode | |
| - arch: x86 | |
| build_type: Debug | |
| # TODO(#15070): Undo exclusion of the shard if we can reduce PDB size. | |
| - shard: Core4 | |
| build_type: Debug | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| with: | |
| ref: ${{ inputs.checkout-ref }} | |
| - uses: google-github-actions/auth@v2 | |
| if: ${{ inputs.sccache-mode == 'READ_WRITE' && inputs.vcpkg-cache-mode == 'readwrite' }} | |
| with: | |
| create_credentials_file: true | |
| credentials_json: ${{ secrets.BUILD_CACHE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| id: py311 | |
| with: | |
| python-version: '3.11' | |
| - uses: google-github-actions/setup-gcloud@v2 | |
| env: | |
| CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }} | |
| - name: Dynamic Configuration | |
| id: dynamic | |
| shell: bash | |
| run: | | |
| echo "vcpkg-version=$(cat ci/etc/vcpkg-version.txt)" >> "${GITHUB_OUTPUT}" | |
| core1_features=(bigtable) | |
| core2_features=(spanner) | |
| core3_features=(storage) | |
| core4_features=(storage_grpc) | |
| core5_features=(pubsub pubsublite) | |
| # These are the libraries with the most "clients". To build the list | |
| # run something like this and create shards: | |
| # | |
| # git grep -l 'class.*Client' 'google/cloud/**_client.h' | | |
| # egrep -v "(bigtable/|internal/|pubsub/|pubsublite/|spanner/|storage/)" | | |
| # cut -f -3 -d/| sort | uniq -c | sort -n | | |
| # awk '{ s += $1; print s, $0}' | |
| # | |
| shard1_features=( | |
| appengine | |
| dataproc | |
| discoveryengine | |
| monitoring | |
| retail | |
| sql | |
| dialogflow_cx | |
| dialogflow_es | |
| ) | |
| shard2_features=( | |
| beyondcorp | |
| billing | |
| binaryauthorization | |
| gkemulticloud | |
| logging | |
| notebooks | |
| osconfig | |
| servicecontrol | |
| speech | |
| support | |
| ) | |
| shard3_features=( | |
| securesourcemanager | |
| securitycentermanagement | |
| servicehealth | |
| servicemanagement | |
| serviceusage | |
| shell | |
| storagecontrol | |
| storageinsights | |
| storagetransfer | |
| tasks | |
| telcoautomation | |
| texttospeech | |
| timeseriesinsights | |
| translate | |
| videointelligence | |
| vmmigration | |
| vmwareengine | |
| vpcaccess | |
| webrisk | |
| websecurityscanner | |
| workstations | |
| automl | |
| cloudbuild | |
| cloudcontrolspartner | |
| composer | |
| containeranalysis | |
| datastore | |
| eventarc | |
| functions | |
| iap | |
| language | |
| metastore | |
| networkconnectivity | |
| networkservices | |
| policytroubleshooter | |
| profiler | |
| redis | |
| securitycenter | |
| servicedirectory | |
| tpu | |
| trace | |
| vision | |
| workflows | |
| ) | |
| shard4_features=( | |
| accessapproval | |
| accesscontextmanager | |
| advisorynotifications | |
| alloydb | |
| apigateway | |
| apigeeconnect | |
| apikeys | |
| apphub | |
| artifactregistry | |
| assuredworkloads | |
| backupdr | |
| baremetalsolution | |
| batch | |
| certificatemanager | |
| cloudquotas | |
| commerce | |
| confidentialcomputing | |
| config | |
| connectors | |
| contactcenterinsights | |
| container | |
| datafusion | |
| datamigration | |
| datastream | |
| deploy | |
| developerconnect | |
| dlp | |
| documentai | |
| domains | |
| edgecontainer | |
| edgenetwork | |
| essentialcontacts | |
| filestore | |
| financialservices | |
| gkebackup | |
| gkeconnect | |
| gkehub | |
| ) | |
| shard5_features=( | |
| video | |
| datacatalog | |
| iam | |
| kms | |
| run | |
| talent | |
| contentwarehouse | |
| dataplex | |
| bigquery | |
| bigquerycontrol | |
| resourcemanager | |
| ) | |
| if [[ "${{ matrix.shard }}" == "Core1" ]]; then | |
| features="$(printf ",%s" "${core1_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{ matrix.shard }}" == "Core2" ]]; then | |
| features="$(printf ",%s" "${core2_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{ matrix.shard }}" == "Core3" ]]; then | |
| features="$(printf ",%s" "${core3_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{ matrix.shard }}" == "Core4" ]]; then | |
| features="$(printf ",%s" "${core4_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{ matrix.shard }}" == "Core5" ]]; then | |
| features="$(printf ",%s" "${core5_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Compute" ]]; then | |
| echo "features=compute" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "AIPlatform" ]]; then | |
| echo "features=aiplatform" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Shard1" ]]; then | |
| features="$(printf ",%s" "${shard1_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Shard2" ]]; then | |
| features="$(printf ",%s" "${shard2_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Shard3" ]]; then | |
| features="$(printf ",%s" "${shard3_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Shard4" ]]; then | |
| features="$(printf ",%s" "${shard4_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| elif [[ "${{matrix.shard}}" == "Shard5" ]]; then | |
| features="$(printf ",%s" "${shard5_features[@]}")" | |
| echo "features=${features:1}" >> "${GITHUB_OUTPUT}" | |
| else | |
| skipped_features=("${core1_features[@]}") | |
| skipped_features+=("${core2_features[@]}") | |
| skipped_features+=("${core3_features[@]}") | |
| skipped_features+=("${core4_features[@]}") | |
| skipped_features+=("${core5_features[@]}") | |
| skipped_features+=(compute) | |
| skipped_features+=(aiplatform) | |
| skipped_features+=("${shard1_features[@]}") | |
| skipped_features+=("${shard2_features[@]}") | |
| skipped_features+=("${shard3_features[@]}") | |
| skipped_features+=("${shard4_features[@]}") | |
| skipped_features+=("${shard5_features[@]}") | |
| # We use vcpkg in this build, which ships with Protobuf v21.x. | |
| # Both `asset` and `channel` require Protobuf >= 23.x to compile on | |
| # Windows. | |
| skipped_features+=(asset channel) | |
| skipped="$(printf ",-%s" "${skipped_features[@]}")" | |
| echo "features=__ga_libraries__,__experimental_libraries__,${skipped:1}" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: Pre Build Disk Space | |
| shell: bash | |
| run: df -m | |
| - name: Download and Install CMake | |
| shell: bash | |
| run: | | |
| choco install -y --allow-downgrade cmake --version 3.31.6 || \ | |
| (sleep 60 ; choco install -y --allow-downgrade cmake --version 3.31.6) || \ | |
| (sleep 120 ; choco install -y --allow-downgrade cmake --version 3.31.6) | |
| - name: Download and Install sccache | |
| if: ${{ inputs.sccache-mode != 'DISABLED' }} | |
| working-directory: "${{runner.temp}}" | |
| shell: bash | |
| run: | | |
| mkdir -p /c/Users/runneradmin/.cargo/bin | |
| curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.9.1/sccache-v0.9.1-x86_64-pc-windows-msvc.tar.gz | \ | |
| tar -zxf - --strip-components=1 | |
| chmod +x sccache.exe | |
| mv sccache.exe /c/Users/runneradmin/.cargo/bin | |
| - name: Download and Install vcpkg | |
| shell: bash | |
| run: | | |
| cd "${TEMP}" | |
| mkdir -p .build/vcpkg | |
| curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.dynamic.outputs.vcpkg-version }}.tar.gz" | | |
| tar -C .build/vcpkg --strip-components=1 -zxf - | |
| .build/vcpkg/bootstrap-vcpkg.sh -disableMetrics | |
| # go/github-actions#gha-bestpractices explains why we use a SHA instead of | |
| # a named version for this runner. We could avoid using this runner with the | |
| # ideas from: | |
| # https://github.com/microsoft/vswhere/wiki/Find-VC | |
| # Note that in other runners the publisher is GitHub. If we trust GitHub | |
| # to run the VM, we should trust their runners. | |
| - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # @v1.13.0 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Build google-cloud-cpp | |
| shell: bash | |
| run: | | |
| export VCPKG_ROOT="${TEMP}/.build/vcpkg" | |
| export CLOUDSDK_PYTHON="${{ steps.py311.outputs.python-path }}" | |
| # Put the CMake output in a directory with more space and keep it short | |
| # to avoid running into the MSVC limits. | |
| export CMAKE_OUT='c:\b' | |
| export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }} | |
| ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${{ steps.dynamic.outputs.features }} | |
| - name: Post Build Disk Space | |
| shell: bash | |
| run: df -m | |
| env: | |
| SCCACHE_GCS_BUCKET: cloud-cpp-community-gha-cache | |
| SCCACHE_GCS_KEY_PREFIX: sccache/${{ matrix.msvc }}/${{ matrix.arch}}/${{ matrix.build_type }} | |
| SCCACHE_GCS_RW_MODE: ${{ inputs.sccache-mode }} | |
| SCCACHE_IGNORE_SERVER_IO_ERROR: 1 | |
| VCPKG_BINARY_SOURCES: x-gcs,gs://cloud-cpp-community-gha-cache/vcpkg-cache/${{ matrix.msvc }},${{ inputs.vcpkg-cache-mode }} | |
| VCPKG_TRIPLET: ${{ matrix.arch }}-windows | |
| GHA_TEST_BUCKET: "gcs-grpc-team-cloud-cpp-testing-bucket" |