Skip to content

Commit 4dd95a9

Browse files
authored
Merge pull request #61 from scotthart/add_first_gha_build
ci: add gha setup
2 parents c95a782 + 7efbe23 commit 4dd95a9

File tree

17 files changed

+1801
-0
lines changed

17 files changed

+1801
-0
lines changed

.github/workflows/macos-bazel.yml

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
name: macOS-Bazel-Builds
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
checkout-ref:
7+
required: true
8+
description: "The ref we want to compile"
9+
type: string
10+
bazel-cache-mode:
11+
required: true
12+
description: "READ_WRITE or READ_ONLY"
13+
type: string
14+
execute-integration-tests:
15+
required: true
16+
description: "Integration tests require credentials."
17+
type: boolean
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
bazel:
24+
name: bazel + ${{ matrix.os }} + ${{ matrix.shard }}
25+
runs-on: ${{ matrix.os }}
26+
permissions:
27+
contents: 'read'
28+
id-token: 'write'
29+
strategy:
30+
# Continue other builds even if one fails
31+
fail-fast: false
32+
matrix:
33+
os: [ macos-14 ]
34+
shard:
35+
- Core
36+
- Bigtable
37+
- Pub/Sub
38+
- Spanner
39+
- Storage
40+
- Compute
41+
- AIPlatform
42+
- Shard1
43+
- Shard2
44+
- Other
45+
include:
46+
- shard: Core
47+
targets:
48+
- //google/cloud:all
49+
# - //generator/... # Does not build on macOS
50+
# - //docfx/... # Does not build on macOS
51+
- +//examples/...
52+
- shard: Bigtable
53+
targets:
54+
- //google/cloud/bigtable/...
55+
- shard: Pub/Sub
56+
targets:
57+
- //google/cloud/pubsub/...
58+
- +//google/cloud/pubsublite/...
59+
- shard: Spanner
60+
targets:
61+
- //google/cloud/spanner/...
62+
- shard: Storage
63+
targets:
64+
- //google/cloud/storage/...
65+
# Include the top-level examples because they require the libs anyway.
66+
- shard: Compute
67+
targets:
68+
- //google/cloud/compute/...
69+
- shard: AIPlatform
70+
targets:
71+
- //google/cloud/aiplatform/...
72+
- shard: Shard1
73+
targets:
74+
# Run this:
75+
#
76+
# git grep -l 'class.*Client' 'google/cloud/**_client.h' |
77+
# egrep -v "(bigtable/|internal/|pubsub/|spanner/|storage/)" |
78+
# cut -f -3 -d/| sort | uniq -c | sort -n |
79+
# awk '{ s += $1; print s, $0}'
80+
#
81+
# and pick the approximate midpoint
82+
#
83+
# Also, it is a good idea to keep `sql` and `bigquerycontrol`
84+
# together, as they both require our internal REST libraries.
85+
- //google/cloud/bigquerycontrol/...
86+
- +//google/cloud/appengine/...
87+
- +//google/cloud/dataproc/...
88+
- +//google/cloud/monitoring/...
89+
- +//google/cloud/retail/...
90+
- +//google/cloud/discoveryengine/...
91+
- +//google/cloud/sql/...
92+
- +//google/cloud/dialogflow_cx/...
93+
- +//google/cloud/dialogflow_es/...
94+
- shard: Shard2
95+
targets:
96+
- //google/cloud/networkconnectivity/...
97+
- +//google/cloud/networkservices/...
98+
- +//google/cloud/policytroubleshooter/...
99+
- +//google/cloud/profiler/...
100+
- +//google/cloud/redis/...
101+
- +//google/cloud/securitycenter/...
102+
- +//google/cloud/servicedirectory/...
103+
- +//google/cloud/tpu/...
104+
- +//google/cloud/trace/...
105+
- +//google/cloud/vision/...
106+
- +//google/cloud/workflows/...
107+
- +//google/cloud/beyondcorp/...
108+
- +//google/cloud/billing/...
109+
- +//google/cloud/binaryauthorization/...
110+
- +//google/cloud/gkemulticloud/...
111+
- +//google/cloud/logging/...
112+
- +//google/cloud/notebooks/...
113+
- +//google/cloud/osconfig/...
114+
- +//google/cloud/servicecontrol/...
115+
- +//google/cloud/speech/...
116+
- +//google/cloud/support/...
117+
- +//google/cloud/video/...
118+
- +//google/cloud/datacatalog/...
119+
- +//google/cloud/iam/...
120+
- +//google/cloud/run/...
121+
- +//google/cloud/talent/...
122+
- +//google/cloud/contentwarehouse/...
123+
- +//google/cloud/dataplex/...
124+
- +//google/cloud/kms/...
125+
- +//google/cloud/bigquery/...
126+
- +//google/cloud/resourcemanager/...
127+
- shard: Other
128+
targets:
129+
- //...
130+
# Skip top-level targets (e.g. //:bigtable).
131+
- -//:all
132+
# From Core
133+
- -//generator/...
134+
- -//docfx/...
135+
- -//google/cloud:all
136+
- -//examples/...
137+
# From Bigtable
138+
- -//google/cloud/bigtable/...
139+
# From Pub/Sub
140+
- -//google/cloud/pubsub/...
141+
- -//google/cloud/pubsublite/...
142+
# From Spanner
143+
- -//google/cloud/spanner/...
144+
# From Storage
145+
- -//google/cloud/storage/...
146+
# From Compute
147+
- -//google/cloud/compute/...
148+
# From AIPlatform
149+
- -//google/cloud/aiplatform/...
150+
# From Shard1
151+
- -//google/cloud/appengine/...
152+
- -//google/cloud/dataproc/...
153+
- -//google/cloud/monitoring/...
154+
- -//google/cloud/retail/...
155+
- -//google/cloud/discoveryengine/...
156+
- -//google/cloud/sql/...
157+
- -//google/cloud/dialogflow_cx/...
158+
- -//google/cloud/dialogflow_es/...
159+
# From Shard2
160+
- -//google/cloud/networkconnectivity/...
161+
- -//google/cloud/networkservices/...
162+
- -//google/cloud/policytroubleshooter/...
163+
- -//google/cloud/profiler/...
164+
- -//google/cloud/redis/...
165+
- -//google/cloud/securitycenter/...
166+
- -//google/cloud/servicedirectory/...
167+
- -//google/cloud/tpu/...
168+
- -//google/cloud/trace/...
169+
- -//google/cloud/vision/...
170+
- -//google/cloud/workflows/...
171+
- -//google/cloud/beyondcorp/...
172+
- -//google/cloud/billing/...
173+
- -//google/cloud/binaryauthorization/...
174+
- -//google/cloud/gkemulticloud/...
175+
- -//google/cloud/logging/...
176+
- -//google/cloud/notebooks/...
177+
- -//google/cloud/osconfig/...
178+
- -//google/cloud/servicecontrol/...
179+
- -//google/cloud/speech/...
180+
- -//google/cloud/support/...
181+
- -//google/cloud/video/...
182+
- -//google/cloud/datacatalog/...
183+
- -//google/cloud/iam/...
184+
- -//google/cloud/run/...
185+
- -//google/cloud/talent/...
186+
- -//google/cloud/contentwarehouse/...
187+
- -//google/cloud/dataplex/...
188+
- -//google/cloud/kms/...
189+
- -//google/cloud/bigquery/...
190+
- -//google/cloud/bigquerycontrol/...
191+
- -//google/cloud/resourcemanager/...
192+
steps:
193+
- uses: actions/checkout@v4
194+
with:
195+
ref: ${{ inputs.checkout-ref }}
196+
- uses: google-github-actions/auth@v2
197+
if: ${{ inputs.bazel-cache-mode == 'READ_WRITE' }}
198+
with:
199+
create_credentials_file: true
200+
credentials_json: ${{ secrets.BUILD_CACHE_KEY }}
201+
- name: Install bash >= 5.x
202+
run: brew install bash
203+
- name: Pre Tests Disk Space
204+
run: df -m
205+
- name: Build google-cloud-cpp
206+
run: |
207+
export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }}
208+
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
209+
ci/gha/builds/macos-bazel.sh ${{ join(matrix.targets, ' ') }}
210+
- name: Post Tests Disk Space
211+
run: df -m
212+
env:
213+
BAZEL_REMOTE_CACHE: https://storage.googleapis.com/cloud-cpp-community-gha-cache/bazel-cache/${{ matrix.os }}
214+
GHA_TEST_BUCKET: "gcs-grpc-team-cloud-cpp-testing-bucket"

0 commit comments

Comments
 (0)