Skip to content

Commit 1260047

Browse files
authored
impl: faster check-api runs (#11719)
1 parent c8cfde9 commit 1260047

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

ci/cloudbuild/builds/check-api.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ io::run cmake "${cmake_args[@]}" \
4141
io::run cmake --build cmake-out
4242
io::run cmake --install cmake-out >/dev/null
4343

44-
mapfile -t ga_list < <(cmake -DCMAKE_MODULE_PATH="${PWD}/cmake" -P cmake/print-ga-libraries.cmake 2>&1)
45-
# These libraries are not "features", but they are part of the public API
46-
ga_list+=("common" "grpc_utils")
44+
if [ "${GOOGLE_CLOUD_CPP_CHECK_API:-}" ]; then
45+
IFS=',' read -ra library_list <<<"${GOOGLE_CLOUD_CPP_CHECK_API}"
46+
else
47+
mapfile -t library_list < <(cmake -DCMAKE_MODULE_PATH="${PWD}/cmake" -P cmake/print-ga-libraries.cmake 2>&1)
48+
# These libraries are not "features", but they are part of the public API
49+
library_list+=("common" "grpc_utils")
50+
fi
4751

4852
# Uses `abi-dumper` to dump the ABI for the given library, which should
4953
# be installed at the given @p prefix, and `abi-compliance-checker` to
@@ -131,7 +135,7 @@ function check_abi() {
131135
}
132136
export -f check_abi # enables this function to be called from a subshell
133137

134-
mapfile -t libraries < <(printf "google_cloud_cpp_%s\n" "${ga_list[@]}")
138+
mapfile -t libraries < <(printf "google_cloud_cpp_%s\n" "${library_list[@]}")
135139

136140
# Run the check_abi function for each library in parallel since it is slow.
137141
echo "${libraries[@]}" | xargs -P "$(nproc)" -n 1 \

doc/contributor/howto-guide-adding-generated-libraries.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,8 @@ ci/cloudbuild/build.sh -t checkers-pr
226226
For new GA libraries you need to create the API baseline.
227227

228228
```
229-
ci/cloudbuild/build.sh -t check-api-pr
230-
git add ci/abi-dumps/google_cloud_cpp_${library}.expected.abi.dump.gz
231-
git commit -m"Add API baseline" ci/abi-dumps/google_cloud_cpp_${library}.expected.abi.dump.gz
232-
git restore ci/abi-dumps/
229+
env GOOGLE_CLOUD_CPP_CHECK_API=${library} ci/cloudbuild/build.sh -t check-api-pr
230+
git commit -m"Add API baseline" ci/abi-dumps/
233231
```
234232

235233
## Verify everything compiles

0 commit comments

Comments
 (0)