Skip to content

Commit 0217f86

Browse files
authored
Enable ready-only bazel cache (#1294)
This PR enables read-only bazel cache Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
1 parent 8e11961 commit 0217f86

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
5656
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
5757
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
58+
else
59+
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
5860
fi
5961
set -x -e
6062
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
@@ -75,6 +77,8 @@ jobs:
7577
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
7678
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
7779
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
80+
else
81+
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
7882
fi
7983
set -x -e
8084
bash -x -e .github/workflows/build.space.sh
@@ -93,6 +97,8 @@ jobs:
9397
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
9498
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
9599
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
100+
else
101+
export BAZEL_OPTIMIZATION="--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
96102
fi
97103
set -x -e
98104
bash -x -e .github/workflows/build.space.sh
@@ -112,6 +118,8 @@ jobs:
112118
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
113119
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
114120
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
121+
else
122+
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
115123
fi
116124
set -x -e
117125
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
@@ -223,6 +231,8 @@ jobs:
223231
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
224232
printf '%s\n' "${GCP_CREDS}" >service_account_creds.json
225233
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
234+
else
235+
export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
226236
fi
227237
set -x -e
228238
bash -x -e .github/workflows/build.space.sh
@@ -333,9 +343,11 @@ jobs:
333343
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=true --google_credentials=service_account_creds.json"
334344
) else (
335345
echo %REPO_NAME%
346+
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
336347
)
337348
) else (
338349
echo %EVENT_NAME%
350+
set "BAZEL_OPTIMIZATION=--remote_cache=https://storage.googleapis.com/tensorflow-sigs-io --remote_upload_local_results=false"
339351
)
340352
@echo on
341353
set /P BAZEL_VERSION=< .bazelversion

0 commit comments

Comments
 (0)