Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions github-actions/bazel/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ runs:
with:
path: |
~/.cache/bazelisk
\%LocalAppData\%/bazelisk
key: bazel-version-${{ hashFiles('**/.bazelversion') }}
~/AppData/Local/bazelisk
key: bazel-version-${{ runner.os }}-${{ hashFiles('**/.bazelversion') }}

- name: Setup CI bazelrc config
run: node $GITHUB_ACTION_PATH/setup-ci-bazelrc.mjs
Expand All @@ -32,6 +32,6 @@ runs:
# Note: Bazel repository cache is located in system locations and cannot use
# a shared cache between different runner operating systems.
path: '~/.cache/bazel_repo_cache'
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}
key: bazel-cache-${{ runner.os }}-${{ hashFiles('**/WORKSPACE') }}-${{ hashFiles('**/MODULE.bazel.lock') }}
restore-keys: |
bazel-cache-${{ runner.os }}-
5 changes: 3 additions & 2 deletions github-actions/bazel/setup/setup-ci-bazelrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fs from 'fs';
// in the bazelrc file need to be escaled as otherwise those would escape
// followed characters that weren't supposed to be escaped.
const cachePath = path.join(os.homedir(), '.cache/bazel_repo_cache');
const escapedCachePath = cachePath.replace(/\\/g, '\\\\');
const escapedCachePath = cachePath.replace(/\\/g, '/');

const bazelRcContent = `
# Print all the options that apply to the build.
Expand All @@ -16,7 +16,8 @@ const bazelRcContent = `
build --announce_rc

# Avoids re-downloading NodeJS/browsers all the time.
build --repository_cache=${escapedCachePath}
# Replace path to make it compatable with WSL
build --repository_cache=${escapedCachePath.replace(/c:\//i, '/mnt/c/')}

# More details on failures
build --verbose_failures=true
Expand Down