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
7 changes: 4 additions & 3 deletions .github/workflows/copyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ jobs:
uses: actions/checkout@v4.2.2

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
disk-cache: false
repository-cache: false
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run Copyright Check
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ jobs:
echo "pip_cache=${BASE}/pip" >> "$GITHUB_OUTPUT"

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: false
repository-cache: false
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Prepare cache dirs
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ jobs:
echo "pip_cache=${BASE}/pip" >> "$GITHUB_OUTPUT"

- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: false
repository-cache: false
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Prepare cache dirs
shell: bash
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ jobs:
uses: actions/checkout@v4.2.2

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
disk-cache: false
repository-cache: false
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}


- name: Run Formatting Check
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run License Check via Bazel
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/qnx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ on:
required: false
default: "workflow-approval"
type: string
bazel-disk-cache:
description: "Enable Bazel disk cache on GitHub. The value can be a string to use as cache key for separating workflows"
required: false
default: "true"
type: string
secrets:
score-qnx-license:
description: "Base64-encoded QNX license content"
Expand Down Expand Up @@ -64,11 +69,12 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
disk-cache: ${{ inputs.bazel-disk-cache }}
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Prepare QNX license
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ jobs:
uses: actions/checkout@v4.2.2

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run Static Analysis via Bazel
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}

- name: Run Tests via Bazel
run: |
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,20 @@ To improve performance and reduce redundant downloads across workflow runs, the

```yaml
- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.14.0
uses: bazel-contrib/setup-bazel@0.18.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true
cache-save: ${{ github.event_name == 'push' }}
```

### Benefits

- **`disk-cache`**: Stores compiled Bazel outputs across jobs.
- **`repository-cache`**: Caches external dependencies (e.g., modules, WORKSPACE fetches).
- **`bazelisk-cache`**: Avoids re-downloading Bazel binaries.
- **`cache-save`**: Saves the cache only on push events to avoid unnecessary cache updates (e.g., from pull requests).

This setup significantly reduces CI build time and improves reuse across different workflows.

Expand Down