Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
41b624e
Update dependency node to v20.18.0 (#40)
renovate[bot] Oct 3, 2024
b136f2f
Update dependency @actions/core to v1.11.1 (#41)
renovate[bot] Oct 8, 2024
3736b3b
Update dependency yaml to v2.6.0 (#43)
renovate[bot] Oct 13, 2024
93a7248
Update Node.js to v22 (#45)
renovate[bot] Oct 29, 2024
2ebddb2
Use `process.env.RUNNER_TEMP` instead of `os.tmpdir()` (#47)
aaylward Oct 30, 2024
f3f50ea
Release 0.9.1
invalid-email-address Oct 30, 2024
0acdc34
Update dependency @actions/cache to v3.3.0 (#49)
renovate[bot] Nov 2, 2024
3e48ddd
Update dependency @vercel/ncc to v0.38.3 (#50)
renovate[bot] Nov 15, 2024
8d0361d
Update dependency yaml to v2.6.1 (#51)
renovate[bot] Nov 19, 2024
fda5cfc
Update Node.js to v22.12.0 (#52)
renovate[bot] Dec 4, 2024
89b8ef0
Update dependency @actions/cache to v4 (#53)
renovate[bot] Dec 5, 2024
0f9296f
Allow changing output base path
p0deje Oct 31, 2024
bbf8fe8
Release 0.10.0
invalid-email-address Dec 21, 2024
99f63cf
Update dependency yaml to v2.7.0
renovate[bot] Dec 31, 2024
438b351
Export `BAZELISK_GITHUB_TOKEN` variable
p0deje Jan 5, 2025
465f161
Release 0.11.0
invalid-email-address Jan 5, 2025
451432a
Enable caches for all Bazel commands, not just build-related ones.
phst Jan 4, 2025
c50333a
Release 0.12.0
invalid-email-address Jan 5, 2025
104a0a3
Fix regression with missing token
p0deje Jan 7, 2025
529dbc2
Release 0.12.1
invalid-email-address Jan 7, 2025
6cabfc0
Update Node.js to v22.13.0
renovate[bot] Jan 7, 2025
768017f
Update dependency @actions/tool-cache to v2.0.2 (#62)
renovate[bot] Jan 16, 2025
30f5394
Update Node.js to v22.13.1 (#63)
renovate[bot] Jan 21, 2025
bc949b7
Include repository cache files in the disk cache key. (#64)
bmclarnon Jan 24, 2025
663f88d
Release 0.13.0
invalid-email-address Jan 24, 2025
bb67a55
Update Node.js to v22.14.0 (#65)
renovate[bot] Feb 11, 2025
9824807
Update dependency @actions/cache to v4.0.1 (#66)
renovate[bot] Feb 14, 2025
e0e802d
Add module-root option for changing module location within the reposi…
calebzulawski Feb 21, 2025
e8776f5
Release 0.14.0
invalid-email-address Feb 21, 2025
f3b2b00
Update dependency @actions/cache to v4.0.2 (#70)
renovate[bot] Feb 26, 2025
c46b5ab
Update dependency @actions/cache to v4.0.3 (#74)
renovate[bot] Mar 19, 2025
9ccf8a2
Update actions/cache version to 4.2.2 to resolve caching warning pack…
yx-altera Apr 24, 2025
14421f5
Revert "Update actions/cache version to 4.2.2 to resolve caching warn…
p0deje Apr 28, 2025
f263902
Add `.exe` on windows (#83)
kekxv May 27, 2025
40aa0be
Co-locate Bazel output base with workspace (#82)
p0deje May 27, 2025
4fd964a
Release 0.15.0
invalid-email-address May 27, 2025
976e823
Update Node.js to v22.17.0 (#87)
renovate[bot] Jun 28, 2025
3d67a4f
Update dependency yaml to v2.8.0 (#86)
renovate[bot] Jun 28, 2025
4d8cee1
Update dependency @actions/github to v6.0.1 (#85)
renovate[bot] Jun 28, 2025
20a70d3
Update Node.js to v22.17.1 (#89)
renovate[bot] Jul 16, 2025
54c9086
Include architecture in cache key (#91)
malt3 Aug 5, 2025
25ec8dd
Update dependency yaml to v2.8.1 (#92)
renovate[bot] Aug 5, 2025
ec19395
Update Node.js to v22.18.0 (#93)
renovate[bot] Aug 5, 2025
b02abd0
Update dependency @actions/cache to v4.0.5 (#94)
renovate[bot] Aug 8, 2025
b1c5ac5
Update actions/checkout action to v5 (#95)
renovate[bot] Aug 11, 2025
f22529d
Update Node.js to v22.19.0 (#97)
renovate[bot] Aug 31, 2025
812c637
Update actions/setup-node action to v5 (#98)
renovate[bot] Sep 8, 2025
22f06fe
Update dependency @actions/cache to v4.1.0 (#102)
renovate[bot] Sep 30, 2025
798f81e
Update Node.js to v22.20.0 (#103)
renovate[bot] Sep 30, 2025
2fab424
Update dependency @vercel/ncc to v0.38.4 (#99)
renovate[bot] Sep 30, 2025
4432ac8
Update actions/setup-node action to v6 (#104)
renovate[bot] Oct 14, 2025
81ef0d9
Update dependency yaml to v2.8.2 (#112)
renovate[bot] Dec 4, 2025
6fe2795
Update actions/checkout action to v6 (#109)
renovate[bot] Dec 4, 2025
1ff8ab4
Update Node.js to v24 (#106)
renovate[bot] Dec 4, 2025
7594e1b
Pulling of external-cache parallellized (#110)
leoconco Dec 4, 2025
51f283a
Update Node.js to v24.12.0 (#114)
renovate[bot] Dec 12, 2025
39aba44
Update dependency @actions/core to v2 (#113)
renovate[bot] Dec 12, 2025
5528b80
Update dependency @actions/cache to v5 (#115)
renovate[bot] Dec 12, 2025
905421c
allow a list of files for repositoryCacheConfig (#117)
kseth Dec 16, 2025
43d7d5c
Release 0.16.0
invalid-email-address Dec 16, 2025
271e4c2
fix: Improve error handling in restoreCache (fixes #120) (#122)
vorburger Jan 8, 2026
66d3c1c
chore(deps): update dependency @actions/core to v2.0.2 (#124)
renovate[bot] Jan 8, 2026
e820d6a
chore(deps): update dependency @actions/cache to v5.0.2 (#123)
renovate[bot] Jan 8, 2026
1bf8973
docs: add missing initial "npm install" to Development on README (#126)
vorburger Jan 8, 2026
82d28f5
fix: add logging when failing to restore cache (#127)
vorburger Jan 8, 2026
1dc7f48
fix(deps): update dependency @actions/tool-cache to v3 (#130)
renovate[bot] Jan 8, 2026
dbfe727
fix(deps): update dependency @actions/github to v7 (#129)
renovate[bot] Jan 8, 2026
b26a6f0
Fix bazel version not working with disk cache (#119)
limdor Jan 10, 2026
00e306f
Release 0.17.0
invalid-email-address Jan 10, 2026
be4ac32
allow saving cache to be optional (#131)
titusfortner Jan 11, 2026
b607b8f
Add post-if !cancelled() condition (#128)
vorburger Jan 11, 2026
0831755
Release 0.18.0
invalid-email-address Jan 11, 2026
b6a8ab6
chore(deps): update node.js to v24.13.0 (#132)
renovate[bot] Jan 15, 2026
bb67c3e
chore(deps): update dependency @actions/cache to v5.0.3 (#133)
renovate[bot] Jan 16, 2026
5a2f9a2
fix(deps): update dependency @actions/github to v8 (#134)
renovate[bot] Jan 26, 2026
09d5e77
fix(deps): update dependency @actions/cache to v6 (#144)
renovate[bot] Feb 6, 2026
c9a2a71
fix(deps): update dependency @actions/glob to ^0.6.0 (#142)
renovate[bot] Feb 6, 2026
3af227a
chore(deps): update dependency @actions/tool-cache to v3.0.1 (#139)
renovate[bot] Feb 6, 2026
e74b1ab
fix(deps): update dependency @actions/github to v9 (#140)
renovate[bot] Feb 6, 2026
18fd541
fix(deps): update dependency @actions/core to v3 (#141)
renovate[bot] Feb 6, 2026
3217c4f
fix(deps): update dependency @actions/tool-cache to v4 (#143)
renovate[bot] Feb 6, 2026
887da5f
chore(deps): update node.js to v24.13.1 (#145)
renovate[bot] Feb 10, 2026
417f338
Fix syntax error in README.md for disk-cache (#146)
nnichols Feb 23, 2026
3096290
chore(deps): update node.js to v24.14.0 (#147)
renovate[bot] Feb 25, 2026
7ff4255
Update Node version to address deprecation warning. (#148)
alsutton Mar 13, 2026
63ef5dc
chore(deps): update dependency yaml to v2.8.3 (#150)
renovate[bot] Mar 21, 2026
b496e79
Migrate to ESM (#151)
p0deje Mar 23, 2026
c5acdfb
Release 0.19.0
invalid-email-address Mar 23, 2026
b497b82
Merge remote-tracking branch 'upstream/main' into by/pull-upstream
bruce-y Mar 26, 2026
19a0cfc
convert
bruce-y Mar 26, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- ubuntu
- windows
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./
- if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
cache: npm
node-version-file: package.json
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 24.0.0
nodejs 24.14.0
92 changes: 78 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and provides an advanced fine-grained caching to improve workflows performance.
## Usage

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
Expand Down Expand Up @@ -39,15 +39,15 @@ Default `""`.
#### Install Bazelisk 1.x

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-version: 1.x
```

#### Install exact Bazelisk version

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-version: 1.19.0
```
Expand All @@ -67,22 +67,46 @@ Default `""`.
#### Enable Bzlmod

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelrc: common --enable_bzlmod
```

#### Add colors and timestamps

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelrc: |
build --color=yes
build --show_timestamps
```
</details>

### `cache-save`

Whether to save caches at the end of the workflow.

Set to `false` for pull requests to allow cache restoration without saving,
which prevents PRs from polluting the cache while still benefiting from it.

Default `true`.

<details>
<summary>Examples</summary>

#### Disable cache saving on pull requests

```yaml
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
cache-save: ${{ github.event_name != 'pull_request' }}
```
</details>

### `disk-cache`

Enable [`disk_cache`][2] and store it on GitHub based on contents of `BUILD` files.
Expand All @@ -97,17 +121,17 @@ Default `false`.
#### Share a single disk cache

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
disk-cache: true
```

#### Separate disk caches between workflows

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
disk-cache: ${{ github.workflow }}}
disk-cache: ${{ github.workflow }}
```
</details>

Expand All @@ -129,15 +153,15 @@ Default `false`.
#### Enable external repositories caches

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
external-cache: true
```

#### Cache NPM repositories based on `package-lock.json` contents

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
external-cache: |
manifest:
Expand All @@ -147,7 +171,7 @@ Default `false`.
#### Do not cache Ruby on Windows

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
external-cache: |
manifest:
Expand All @@ -167,12 +191,42 @@ Default `""`.
#### Authenticate via key

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
google-credentials: ${{ secrets.GOOGLE_CLOUD_KEY }}
```
</details>

### `module-root`

Bazel module root directory, where `MODULE.bazel` and `WORKSPACE` is found.

Change this value to the module root if it's not the repository root.

Default `"."`.

### `output-base`

Change Bazel output base directory.

You might want to change it when running on self-hosted runners with a custom directory layout.

Default is one of the following:

- `$HOME/.bazel` on Linux and macOS
- `D:/_bazel` on Windows

<details>
<summary>Examples</summary>

#### Use `C` drive letter

```yaml
- uses: bazel-contrib/setup-bazel@0.19.0
with:
output-base: C:/_bazel
```
</details>

### `repository-cache`

Expand All @@ -188,18 +242,27 @@ Default `false`.
#### Store a single repository cache

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
repository-cache: true
```

#### Store a repository cache from a custom location

```yaml
- uses: bazel-contrib/setup-bazel@0.9.0
- uses: bazel-contrib/setup-bazel@0.19.0
with:
repository-cache: examples/gem/WORKSPACE
```

#### Store a repository cache from a list of custom locations
```yaml
- uses: bazel-contrib/setup-bazel@0.19.0
with:
repository-cache: |
- MODULE.bazel
- requirements_locked.txt
```
</details>

## Migrating from [`bazelbuild/setup-bazelisk`][6]
Expand All @@ -213,6 +276,7 @@ However, if you used a `bazel-version` input before, you will need to remove it
To build action, run the following command:

```sh
$ npm install
$ npm run build
```

Expand Down
6 changes: 3 additions & 3 deletions __tests__/restore-cache.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const core = require('@actions/core');
const { mountStickyDisk } = require('../stickydisk');
const { loadStickyDisk, setupBazel } = require('../index');
import * as core from '@actions/core';
import { mountStickyDisk } from '../stickydisk.js';
import { loadStickyDisk, setupBazel } from '../index.js';

// Mock the stickydisk module
jest.mock('../stickydisk', () => ({
Expand Down
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: Extra contents to write to user .bazelrc
required: false
default: ""
cache-save:
description: Whether to save caches. Set to false for pull requests to allow restores but prevent saves.
required: false
default: "true"
cache-version:
description: Version of all caches
required: false
Expand All @@ -29,6 +33,14 @@ inputs:
description: Google Cloud account key for remote cache
required: false
default: ""
module-root:
description: Bazel module root directory. Default is `.`
required: false
default: "."
output-base:
description: Bazel output base directory. Default is $HOME/.cache/bazel (POSIX) or D:/_bazel (Windows)
required: false
default: ""
repository-cache:
description: Cache repositories based on MODULE.bazel/WORKSPACE
required: false
Expand All @@ -42,3 +54,4 @@ runs:
using: node24
main: dist/main/index.js
post: dist/post/index.js
post-if: "!cancelled()"
Loading
Loading