Skip to content

Cargo

Avrea caches crates from crates.io so that cargo build and cargo fetch resolve dependencies from colocated cache on repeat runs.

Cargo is pre-configured via ~/.cargo/config.toml:

~/.cargo/config.toml
[registries.cache]
index = "sparse+https://avrea-host:8443/cargo/"
[source.crates-io]
replace-with = "cache"

Your workflow needs no changes:

workflow.yml
jobs:
build:
runs-on: avrea-ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: cargo build --release

Create or append to ~/.cargo/config.toml:

~/.cargo/config.toml
[registries.cache]
index = "sparse+https://avrea-host:8443/cargo/"
[source.crates-io]
replace-with = "cache"