# ccache

Avrea provides a remote storage endpoint for [ccache](https://ccache.dev/).
Compilation outputs are cached so that unchanged source files skip recompilation.

## On Avrea runners

ccache is pre-configured:

```bash
CCACHE_REMOTE_STORAGE="http://cache.avrea.com:8290/ccache-build/cas|layout=flat"
PATH="/usr/lib/ccache:$PATH"  # ccache compiler wrappers
```

With the ccache compiler wrappers on `PATH`, your workflow needs no changes:

```yaml title="workflow.yml"
jobs:
  build:
    runs-on: avrea-ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: mkdir build && cd build && cmake ..
      - run: make -j$(nproc)
      - run: ccache --show-stats
```

## Manual setup

```yaml
env:
  CCACHE_REMOTE_STORAGE: "http://cache.avrea.com:8290/ccache-build/cas|layout=flat"

steps:
  - uses: actions/checkout@v7
  - run: |
      export PATH="/usr/lib/ccache:$PATH"
      mkdir build && cd build && cmake ..
      make -j$(nproc)
  - run: ccache --show-stats
```