mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-23 03:41:05 -05:00
Create separate Linux/macOS examples for Bazel
This commit is contained in:
parent
ef11f54eee
commit
4b8460cbff
1 changed files with 18 additions and 4 deletions
22
examples.md
22
examples.md
|
@ -661,18 +661,32 @@ steps:
|
||||||
|
|
||||||
## * - Bazel
|
## * - Bazel
|
||||||
|
|
||||||
|
[`bazelisk`](https://github.com/bazelbuild/bazelisk) does not have be to separately downloaded and installed because it's already included in GitHub's `ubuntu-latest` base image.
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache Bazel
|
- name: Cache Bazel
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/bazel # Linux
|
~/.cache/bazel
|
||||||
/private/var/tmp/_bazel_runner/ # macOS
|
|
||||||
# TODO Add Windows if you know where it is, based on https://bazel.build/remote/output-directories
|
|
||||||
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
|
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-bazel-
|
${{ runner.os }}-bazel-
|
||||||
- run: bazelisk test //...
|
- run: bazelisk test //...
|
||||||
```
|
```
|
||||||
|
|
||||||
[`bazelisk`](https://github.com/bazelbuild/bazelisk) does not have be to separately downloaded and installed because it's already included in GitHub's `ubuntu-latest` base image.
|
### macOS
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Cache Bazel
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/private/var/tmp/_bazel_runner/
|
||||||
|
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-bazel-
|
||||||
|
- run: bazelisk test //...
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue