Skip to content

Rust Cache using sccache

Actions
Use sccache in your CI for Rust builds
v1.1.0
Latest
Star (10)

sccache-action

GitHub action for using sccache.

Usage

In your workflow, add the following step:

- name: Cache Rust compilation
  uses: metalbear-co/sccache-action@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    # Optional, default is `sccache-`
    cache-from: sccache-${{ runner.os }}-
    # Optional, default is `sccache-latest`
    cache-to: sccache-${{ runner.os }}-${{ github.sha }}

This action uses the GitHub API, so the github-token is necessary in order to avoid issues with rate limiting.

For information about cache-from and cache-to, please refer to the sccache docs and Github Actions docs.

By default, this action will set the following environment variables as required by sccache:

  • RUSTC_WRAPPER="<path to sccache>"
  • CARGO_INCREMENTAL=0

Implementation examples

mirrord - ci.yaml

Changelog

See CHANGELOG.md

Contributing

You're welcome to contribute.

License

Released under MIT License

Rust Cache using sccache is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Use sccache in your CI for Rust builds
v1.1.0
Latest

Rust Cache using sccache is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.