Mirror of bazel-contrib/setup-bazel for self-hosted Forgejo Actions
Find a file
2024-02-13 06:22:58 -08:00
.github/workflows Add basic CI check 2024-02-07 06:24:11 -08:00
dist Support bazelisk-version input 2024-02-07 06:24:11 -08:00
.gitignore Hello world 2023-01-04 16:31:00 -08:00
.tool-versions Update to NodeJS 20 2024-02-13 06:22:58 -08:00
action.yml Update to NodeJS 20 2024-02-13 06:22:58 -08:00
config.js Support bazelisk-version input 2024-02-07 06:24:11 -08:00
index.js Support bazelisk-version input 2024-02-07 06:24:11 -08:00
LICENSE Initial commit 2023-01-04 16:27:56 -08:00
package-lock.json Support bazelisk-version input 2024-02-07 06:24:11 -08:00
package.json Update to NodeJS 20 2024-02-13 06:22:58 -08:00
post.js Allow to disable specific external caches 2024-01-18 11:56:04 -08:00
README.md Release 0.5.0 2024-02-07 06:38:33 -08:00
util.js Fix regression in gathering folder size 2023-11-26 17:11:31 -08:00

setup-bazel

This action allows to properly configure Bazelisk and Bazel on all operating systems and provides an advanced fine-grained caching to improve workflows performance.

Inputs

bazelisk-cache

Cache bazelisk downloads based on contents of a .bazelversion file.

Default false.

bazelisk-version

bazelisk version to download and use.

Supports semver specification and ranges. Leave empty to use pre-installed Bazelisk.

Default "".

bazelrc

Extra contents to write to a user's bazelrc file.

Default "".

disk-cache

Enable disk_cache and store it on GitHub based on contents of BUILD files.

You can also pass a string to use as a cache key to separate caches from different workflows.

Default false.

external-cache

Cache external/ repositories based on contents of a WORKSPACE file. Only repositories exceeding 10MB are being cached.

You can also pass a YAML object where key is the name of the external repository and value is the list of files which contents are used to calculate cache key.

Default false.

repository-cache

Enable repository_cache and store it on GitHub based on contents of a WORKSPACE file.

Default false.

Examples

Simple configuration

- uses: p0deje/setup-bazel@0.5.0

Custom Bazelisk version

- uses: p0deje/setup-bazel@0.5.0
  with:
    bazelisk-version: 1.19.0

Additional .bazelrc options

- uses: p0deje/setup-bazel@0.5.0
  with:
    bazelrc: |
      build --show_timestamps

Full caching enabled

- uses: p0deje/setup-bazel@0.5.0
  with:
    bazelisk-cache: true
    disk-cache: true
    external-cache: true
    repository-cache: true

Separate disk cache between workflows

- uses: p0deje/setup-bazel@0.5.0
  with:
    disk-cache: ${{ github.workflow }}}

Cache external repository based on different files

- uses: p0deje/setup-bazel@0.5.0
  with:
    external-cache: |
      manifest:
        npm: package-lock.json

Disable individual external repositories conditionally

- uses: p0deje/setup-bazel@0.5.0
  with:
    external-cache: |
      manifest:
        ruby: ${{ matrix.os == 'windows' && 'false' || '.ruby-version' }}

Migrating from bazelbuild/setup-bazelisk

You can simply replace bazelbuild/setup-bazelisk action with p0deje/setup-bazel. However, if you used a bazel-version input before, you will need to remove it in favor other ways to specify Bazel version.