From cbb68752b4c6db261317e315b574a698074820c7 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 3 Aug 2023 11:08:55 +0200 Subject: [PATCH] Use a disk cache on windows Building on windows currently takes a long time (> 2h) and fails eventually when the connection to the build event upload service is closed. Using a disk_cache which is stored in Github's action cache hopefully avoids building stackage libraries every time. Currently the cache key depends on the hash of the `stackage_snapshot.yaml` file, so it is evicted whenever that file changes. There is no cache cleanup done currently. --- .bazelrc.common | 1 + .github/workflows/workflow.yaml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.bazelrc.common b/.bazelrc.common index 6b32043ac..a60a8d4df 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -64,6 +64,7 @@ build:ci-common --experimental_repository_cache_hardlinks # Use a remote cache during CI build:ci-windows-bindist --bes_upload_mode=wait_for_upload_complete --bes_timeout=60s +build:ci-windows-bindist --disk_cache=.bazel-cache/disk build:remote-cache --remote_cache=grpcs://remote.buildbuddy.io build:ci-common --remote_timeout=3600 # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`. diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 255527635..1fbcc7526 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -112,6 +112,11 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f - uses: actions/checkout@v3 + - name: Add disk cache + uses: actions/cache@v3 + with: + path: .bazel-cache/disk + key: disk-cache-${{ runner.os }}-${{ hashFiles('stackage_snapshot.yaml') }} - name: Mount Bazel cache uses: actions/cache@v3 with: