Skip to content

Commit e29e345

Browse files
committed
Fix more problems
1 parent ab441e2 commit e29e345

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

.github/actions/set-up-bazelisk/action.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ runs:
4040
steps:
4141
- name: Set environment variables
4242
shell: bash
43-
SHELLOPTS: ${{(inputs.debug || runner.debug) && 'xtrace' || ''}}
43+
env:
44+
SHELLOPTS: ${{(inputs.debug || runner.debug) && 'xtrace' || ''}}
4445
run: |
45-
echo "bazel_cache=$HOME/.cache/bazel" >> "$GITHUB_ENV"
4646
if [[ -n "${{inputs.bazel-version}}" ]]; then
4747
version="${{inputs.bazel-version}}"
4848
elif [[ -f ".bazelversion" ]]; then
@@ -66,12 +66,11 @@ runs:
6666
# shared between workflows.
6767
#
6868
# Bazel --repository_cache: stores the raw downloaded files (like .zip,
69-
# .tar.gz) specified by repository rules like http_archive. This can also
70-
# be shared between workflows.
69+
# .tar.gz) specified by repository rules like http_archive. This can be
70+
# shared between workflows.
7171
#
7272
# Bazel --disk_cache: stores the compiled outputs of build actions, such as
73-
# compiled object files (.o), linked libraries (.so, .dll), binaries, & test
74-
# results. This is also sharable between workflows.
73+
# object files (.o), linked libraries (.so), binaries, & test results.
7574

7675
- name: Set up cache for Bazelisk
7776
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
@@ -83,15 +82,16 @@ runs:
8382
- name: Set up Bazel repository cache
8483
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
8584
with:
86-
path: ${{env.bazel-cache}}/repository_cache
85+
path: ~/.cache/bazel/repository_cache
8786
key: bazel-repo-${{env.bazelversion}}
8887
restore-keys: bazel-repo-
8988

9089
- name: Set up Bazel disk cache
9190
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
9291
with:
93-
path: ${{env.bazel-cache}}/disk_cache
94-
key: bazel-disk-${{runner.os}}-${{runner.arch}}-${{github.ref}}-${{github.sha}}
92+
path: ~/.cache/bazel/disk_cache
93+
# yamllint disable-line rule:line-length
94+
key: bazel-disk-${{runner.os}}-${{runner.arch}}-${{github.ref}}-${{hashFiles('**/WORKSPACE', '**/BUILD', '**/BUILD.tpl', '**/*.bzl')}}
9595
restore-keys: bazel-disk-${{runner.os}}-${{runner.arch}}-${{github.ref}}-
9696

9797
- name: Determine the number of processors we can use
@@ -105,11 +105,13 @@ runs:
105105
106106
- name: Add configuration settings to .bazelrc
107107
shell: bash
108+
env:
109+
SHELLOPTS: ${{(inputs.debug || runner.debug) && 'xtrace' || ''}}
108110
run: |
109111
{
110-
echo "startup --output_base=${{env.bazel-cache}}/output_base"
111-
echo "build --disk_cache=${{env.bazel-cache}}/disk_cache"
112-
echo "build --repository_cache=${{env.bazel-cache}}/repository_cache"
112+
echo "startup --output_base=~/.cache/bazel/output_base"
113+
echo "build --disk_cache=~/.cache/bazel/disk_cache"
114+
echo "build --repository_cache=~/.cache/bazel/repository_cache"
113115
echo "build --jobs=${{env.num_cpus}}"
114116
echo "test --cache_test_results=no"
115117
} >> .bazelrc

0 commit comments

Comments
 (0)