-
Notifications
You must be signed in to change notification settings - Fork 378
109 lines (106 loc) · 3.84 KB
/
windows-bazel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Windows-Builds
on:
workflow_call:
inputs:
checkout-ref:
required: true
description: "The ref we want to compile"
type: string
bazel-cache-mode:
required: true
description: "READ_WRITE or READ_ONLY"
type: string
execute-integration-tests:
required: true
description: "Integration tests require credentials."
type: boolean
permissions:
contents: read
jobs:
bazel:
name: bazel + ${{ matrix.msvc }} + ${{ matrix.compilation_mode }} + ${{ matrix.shard }}
runs-on: windows-2022
permissions:
contents: 'read'
id-token: 'write'
strategy:
# Continue other builds even if one fails
fail-fast: false
matrix:
msvc: [ msvc-2022 ]
# - dbg creates very large debugging files and GHA has limited storage.
# - fastbuild also takes too much storage.
compilation_mode: [ opt ]
shard: [ Core, Compute, AIPlatform, Other ]
include:
- shard: Core
targets:
- //google/cloud:all
# - //generator/... # Does not build on Windows
# - //docfx/... # Does not build on Windows
- //google/cloud/bigtable/...
- //google/cloud/pubsub/...
- //google/cloud/pubsublite/...
- //google/cloud/spanner/...
- //google/cloud/storage/...
- shard: Compute
targets:
- //google/cloud/compute/...
- shard: AIPlatform
targets:
- //google/cloud/aiplatform/...
- shard: Other
targets:
- //...
# Skip top-level targets (e.g. //:bigtable).
- -//:all
# From Core
- -//google/cloud:all
- -//generator/...
- -//docfx/...
- -//google/cloud/bigtable/...
- -//google/cloud/pubsub/...
- -//google/cloud/pubsublite/...
- -//google/cloud/spanner/...
- -//google/cloud/storage/...
# From Compute
- -//google/cloud/compute/...
# From AIPlatform
- -//google/cloud/aiplatform/...
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
- uses: google-github-actions/auth@v2
if: ${{ inputs.bazel-cache-mode == 'READ_WRITE' }}
with:
create_credentials_file: true
credentials_json: ${{ secrets.BUILD_CACHE_KEY }}
# 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
- name: Pre Build Disk Space
shell: bash
run: df -m
- name: Build google-cloud-cpp
shell: bash
run: |
# Having `/usr/bin/link` in the path will conflict with the MSVC linker.
rm -f /usr/bin/link >/dev/null 2>&1
# Bazel creates really long paths, sometimes exceeding the MSVC limits.
# Using a short name like this avoids the problem in most cases.
mkdir -p 'c:\b' || true
export BAZEL_ROOT='c:\b'
export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }}
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
ci/gha/builds/windows-bazel.sh ${{ matrix.compilation_mode }} ${{ join(matrix.targets, ' ') }}
- name: Post Build Disk Space
shell: bash
run: df -m
env:
BAZEL_REMOTE_CACHE: https://storage.googleapis.com/cloud-cpp-community-gha-cache/bazel-cache/${{ matrix.msvc }}/${{ matrix.compilation_mode }}
GHA_TEST_BUCKET: "gcs-grpc-team-cloud-cpp-testing-bucket"