Skip to content

Commit 72bbac0

Browse files
committed
test: add Bazel cache
1 parent eb300c1 commit 72bbac0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/main.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ name: main
44

55
on:
66
push:
7-
branches: [ main ]
7+
branches: [main]
88
pull_request:
9-
branches: [ main ]
9+
branches: [main]
1010
workflow_dispatch:
1111
inputs:
1212
version:
13-
description: 'Version `x.y.z` (without leading `v`)'
13+
description: "Version `x.y.z` (without leading `v`)"
1414
type: string
1515
required: true
1616

@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
path: |
4242
~/.cache/bazel_build_cache
43-
key: ${{ runner.os }}-bazel-test-${{ hashFiles('WORKSPACE') }}
43+
key: ${{ runner.os }}-bazel-test-${{ hashFiles('MODULE.bazel') }}
4444
restore-keys: |
4545
${{ runner.os }}-bazel-test-
4646
- name: Run bazel test
@@ -91,7 +91,7 @@ jobs:
9191
with:
9292
path: |
9393
~/.cache/bazel_build_cache
94-
key: ${{ matrix.os }}-bazel-buildpkg-${{ hashFiles('WORKSPACE') }}
94+
key: ${{ matrix.os }}-bazel-buildpkg-${{ hashFiles('MODULE.bazel') }}
9595
restore-keys: |
9696
${{ matrix.os }}-bazel-buildpkg-
9797
- name: Build Release Package
@@ -117,6 +117,14 @@ jobs:
117117
steps:
118118
- name: Checkout repository
119119
uses: actions/checkout@v4
120+
- name: Bazel cache
121+
uses: actions/cache@v4
122+
with:
123+
path: |
124+
~/.cache/bazel_build_cache
125+
key: bazel-selftest-${{ hashFiles('MODUE.bazel') }}
126+
restore-keys: |
127+
bazel-selftest-
120128
- name: Run bazel to generate worktree
121129
run: bazel build --config=gnu --config=ci //...
122130
- name: Download pkg artifact

0 commit comments

Comments
 (0)