# Bazel Remote Cache

Avrea provides a remote cache endpoint for Bazel. Build and test actions
can be cached so that unchanged targets are never rebuilt.

## On Avrea runners

Bazel is pre-configured via `/etc/bazel.bazelrc`:

```bash title=".bazelrc"
build --remote_cache=http://cache.avrea.com:8290/bazel-build
```

Your workflow needs no changes:

```yaml title="workflow.yml"
jobs:
  build:
    runs-on: avrea-ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: bazel build //...
      - run: bazel test //...
```

## Manual setup

Add to your project `.bazelrc` or `~/.bazelrc`:

```bash title=".bazelrc"
build --remote_cache=http://cache.avrea.com:8290/bazel-build
```

## Configuration options

You can combine the remote cache with other Bazel flags in your `.bazelrc`:

```bash title=".bazelrc"
build --remote_cache=http://cache.avrea.com:8290/bazel-build
build --remote_upload_local_results=true
build --remote_accept_cached=true
```