diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 36cb3427ed0..19df063f7ca 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -64,12 +64,6 @@ jobs: container: image: debian@sha256:823849b88ae7e9b6ceb605fbdf51566499c234a9cfca8da1e4f22234fd65a09c # debian:bullseye-20250317 (amd64) steps: - - name: Common bazel setup - uses: bazel-contrib/setup-bazel@f3f50ea6791b9b0f4c4eeabba4507422426462f5 #aka 0.9.1 - with: - bazelisk-cache: true # Avoid downloading Bazel every time. - disk-cache: ${{ github.workflow }} # Store build cache per workflow. - repository-cache: true # Share repository cache between workflows. - name: Check for dockerenv file run: (ls /.dockerenv && echo 'Found dockerenv') || (echo 'No dockerenv') - name: setup apt @@ -84,6 +78,10 @@ jobs: path: "android-cuttlefish" - name: install bazel run: bash android-cuttlefish/tools/buildutils/installbazel.sh + - name: Authenticate + uses: google-github-actions/auth@v2 + with: + credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}' - name: install package build dependencies run: cd android-cuttlefish/base && mk-build-deps -i -t 'apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y' - name: build base debian package diff --git a/tools/buildutils/installbazel.sh b/tools/buildutils/installbazel.sh index bd769a970d7..79dd031cf8b 100755 --- a/tools/buildutils/installbazel.sh +++ b/tools/buildutils/installbazel.sh @@ -41,3 +41,6 @@ function install_bazel_aarch64() { } install_bazel_$(uname -m) + +echo build --google_default_credentials >> /etc/bazel.bazelrc +echo build --remote_cache=https://storage.googleapis.com/android-cuttlefish-cache >> /etc/bazel.bazelrc